Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MSC4095: Bundled URL previews #4095

Open
wants to merge 13 commits into
base: main
Choose a base branch
from
14 changes: 11 additions & 3 deletions proposals/4095-bundled-url-previews.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ URL previews are primarily meant for text-based message types (`m.text`,
`m.notice`, `m.emote`), but they may be used with any message type, as even
media messages may have captions in the future.

Allowing the omission of `matched_url` is effectively a new feature to send URL
previews without a link in the message text.
Comment on lines +34 to +35

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe that shouldn't be the case though? the field is called matched_urls, which would indicate they need to match something. I'd add that a client might only show previews it also finds a match in the text/markup for? This would also fix the moderation-can't-see-it-issue listed below.


### Extensible events
The definition of `matrix:matched_url` changes from "present in `body`" to
"present in `m.text`", but otherwise the proposal is directly compatible with
Expand All @@ -49,9 +52,9 @@ persistent `mxc://` URI, as well as encrypt it if applicable. A future MSC
could also extend `/preview_url` with a parameter to request a persistent URI.

#### Receiving messages with `m.url_previews`
If an object in the list contains only `matrix:matched_url` and no other fields,
receiving clients should fall back to the old behavior of requesting a preview
using `/preview_url`.
If an object in the list contains only `matrix:matched_url` or `og:url` (but
not both) and no other fields, receiving clients should fall back to the old
behavior of requesting a preview using `/preview_url`.

Clients may choose to ignore bundled data and ask the homeserver for a preview
even if bundled data is present, as a security measure against faking preview
Expand Down Expand Up @@ -245,6 +248,11 @@ encrypted rooms unless the receiver opts in).
## Security considerations
Fake preview data as covered in potential issues.
tulir marked this conversation as resolved.
Show resolved Hide resolved

### Visibility in old clients (T&S)
Clients that don't support this MSC will not display any of the data in the
preview field, which could be abused by spammers if all moderators in a room
are using old clients.

### Generating previews will leak IPs
The sender's client will leak its IP when it fetches previews for URLs typed by
the user. This is generally an acceptable tradeoff, as long as clients take
Expand Down