forgejo/services/webhook
patka 31e7aa61b1 Reduce links in chat notifications to avoid multiple previews (#6908)
Some messages had multiple links resulting in multiple previews per message. The superfluous links have been removed leaving only the most important link. All info the other links provided can be immediately accessed through the main link that is left over.

The fork and push messages still have multiple links because from the former you want to see where the fork originates from, the latter has a link per commit.

Resolves #162

## Checklist

The [contributor guide](https://forgejo.org/docs/next/contributor/) contains information that will be helpful to first time contributors. There also are a few [conditions for merging Pull Requests in Forgejo repositories](https://codeberg.org/forgejo/governance/src/branch/main/PullRequestsAgreement.md). You are also welcome to join the [Forgejo development chatroom](https://matrix.to/#/#forgejo-development:matrix.org).

### Tests

- I added test coverage for Go changes...
  - [x] in their respective `*_test.go` for unit tests.
  - [ ] in the `tests/integration` directory if it involves interactions with a live Forgejo server.
- I added test coverage for JavaScript changes...
  - [ ] in `web_src/js/*.test.js` if it can be unit tested.
  - [ ] in `tests/e2e/*.test.e2e.js` if it requires interactions with a live Forgejo server (see also the [developer guide for JavaScript testing](https://codeberg.org/forgejo/forgejo/src/branch/forgejo/tests/e2e/README.md#end-to-end-tests)).

### Documentation

- [ ] I created a pull request [to the documentation](https://codeberg.org/forgejo/docs) to explain to Forgejo users how to use this change.
- [x] I did not document these changes and I do not expect someone else to do it.

### Release notes

- [ ] I do not want this change to show in the release notes.
- [x] I want the title to show in the release notes with a link to this pull request.
- [ ] I want the content of the `release-notes/<pull request number>.md` to be be used for the release notes instead of the title.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/6908
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Co-authored-by: patka <patka@patka.dev>
Co-committed-by: patka <patka@patka.dev>
2025-02-19 07:08:45 +00:00
..
shared [FEAT] sourcehut webhooks 2024-04-05 10:20:40 +02:00
sourcehut sourcehut: use ssh sources URL when appropriate 2025-01-01 19:46:05 +01:00
TestPushCommits feat: add commit limit for webhook payload (#6797) 2025-02-07 19:26:50 +00:00
default.go chore: fix typos identified by mispell 2024-05-25 09:43:50 +02:00
default_test.go Add testifylint to lint checks (#4535) 2024-07-30 19:41:10 +00:00
deliver.go Support allowed hosts for migrations to work with proxy (#32025) 2024-09-14 17:52:54 +02:00
deliver_test.go Reduce links in chat notifications to avoid multiple previews (#6908) 2025-02-19 07:08:45 +00:00
dingtalk.go style: reenable switch check 2024-08-18 15:19:01 +02:00
dingtalk_test.go Add testifylint to lint checks (#4535) 2024-07-30 19:41:10 +00:00
discord.go Escaping specific markdown in commit messages on Discord-type embeds #3664 (#5811) 2024-11-18 21:47:11 +00:00
discord_test.go Escaping specific markdown in commit messages on Discord-type embeds #3664 (#5811) 2024-11-18 21:47:11 +00:00
feishu.go [REFACTOR] webhook shared code to prevent import cycles 2024-04-04 08:24:33 +02:00
feishu_test.go Add testifylint to lint checks (#4535) 2024-07-30 19:41:10 +00:00
general.go Reduce links in chat notifications to avoid multiple previews (#6908) 2025-02-19 07:08:45 +00:00
general_test.go Escaping specific markdown in commit messages on Discord-type embeds #3664 (#5811) 2024-11-18 21:47:11 +00:00
gogs.go [REFACTOR] webhook shared code to prevent import cycles 2024-04-04 08:24:33 +02:00
main_test.go tests: improve actvititypub integration test code 2024-11-01 22:39:49 +01:00
matrix.go Reduce links in chat notifications to avoid multiple previews (#6908) 2025-02-19 07:08:45 +00:00
matrix_test.go Reduce links in chat notifications to avoid multiple previews (#6908) 2025-02-19 07:08:45 +00:00
msteams.go style: reenable switch check 2024-08-18 15:19:01 +02:00
msteams_test.go Add testifylint to lint checks (#4535) 2024-07-30 19:41:10 +00:00
notifier.go feat: add commit limit for webhook payload (#6797) 2025-02-07 19:26:50 +00:00
notifier_test.go feat: add commit limit for webhook payload (#6797) 2025-02-07 19:26:50 +00:00
packagist.go [REFACTOR] webhook shared code to prevent import cycles 2024-04-04 08:24:33 +02:00
packagist_test.go Add testifylint to lint checks (#4535) 2024-07-30 19:41:10 +00:00
slack.go Reduce links in chat notifications to avoid multiple previews (#6908) 2025-02-19 07:08:45 +00:00
slack_test.go Reduce links in chat notifications to avoid multiple previews (#6908) 2025-02-19 07:08:45 +00:00
telegram.go Reduce links in chat notifications to avoid multiple previews (#6908) 2025-02-19 07:08:45 +00:00
telegram_test.go Reduce links in chat notifications to avoid multiple previews (#6908) 2025-02-19 07:08:45 +00:00
webhook.go webhook: fix getPayloadBranch 2024-04-30 09:38:35 +02:00
webhook_test.go Test webhook email (#33033) 2025-01-05 12:00:26 +00:00
wechatwork.go style: reenable switch check 2024-08-18 15:19:01 +02:00