go-gitea / gitea

Git with a cup of tea! Painless self-hosted all-in-one software development service, including Git hosting, code review, team collaboration, package registry and CI/CD
https://gitea.com
MIT License
45.08k stars 5.49k forks source link

Matrix bot notifications have just a single link #22224

Open aschrijver opened 1 year ago

aschrijver commented 1 year ago

Feature Description

When the Matrix chatroom bot is enabled, it generates 4 link previews (on chatrooms where previews aren't disabled by the moderator), making notifications too lenghty and bot use impractical.

Three of thse links are irrelevant. When clicking the link to an Issue or PR to which the notification relates, all necessary information can be found there.

Downstream: Codeberg/Community/#728 and forgejo/forgejo/#162

Screenshots

Example notification which shows how much space is used up by link previews

jolheiser commented 1 year ago

Does matrix have a way to suppress embeds being sent? For example, Discord allows you to surround a link with <> to suppress the preview.

caesar commented 1 year ago

Does matrix have a way to suppress embeds being sent? For example, Discord allows you to surround a link with <> to suppress the preview.

Not so far as I'm aware. On Matrix they're not embeds; I think it's the client that requestsa link preview from the homeserver (both must have the feature enabled).

Unless I'm mistaken, I believe the only solution to this problem would be to avoid creating the extra links in the first place, and send messages with just a single link.

caesar commented 1 year ago

I should add that in my opinion displaying many link previews is a bug (or at least, undesirable feature) in Element (and perhaps other clients?). However, I would not be opposed to working around it by ensuring we send only a single link in the Matrix messages.