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

MSC4269: Unambiguous mentions in body #4269

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

heftig
Copy link

@heftig heftig commented Feb 25, 2025

Rendered

The message body should contain user IDs instead of display names.

@heftig heftig changed the title MSCXXXX: Unambiguous mentions in body MSC4269: Unambiguous mentions in body Feb 25, 2025
@heftig heftig force-pushed the unambiguous-mentions-in-body branch from 1f05056 to 35e6d3b Compare February 25, 2025 17:07
Signed-off-by: Jan Alexander Steffens (heftig) <[email protected]>
@heftig heftig force-pushed the unambiguous-mentions-in-body branch from 35e6d3b to 6aa0ee1 Compare February 25, 2025 17:08
@tulir tulir added proposal A matrix spec change proposal client-server Client-Server API kind:maintenance MSC which clarifies/updates existing spec needs-implementation This MSC does not have a qualifying implementation for the SCT to review. The MSC cannot enter FCP. labels Feb 25, 2025

## Proposal

The specified client behavior for user and room mentions is modified so that the event's `body`
Copy link
Contributor

Choose a reason for hiding this comment

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

Linking to the spec here might help in better understanding the proposal.

Suggested change
The specified client behavior for user and room mentions is modified so that the event's `body`
The [specified client behavior](https://spec.matrix.org/v1.13/client-server-api/#user-and-room-mentions) for user and room mentions is modified so that the event's `body`

The specified client behavior for user and room mentions is modified so that the event's `body`
should contain the unambiguous user ID, canonical room alias or room ID instead of the anchor's
text component.

Copy link
Contributor

Choose a reason for hiding this comment

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

IIUC, applying this to the example from the spec would lead to the following?

Suggested change
```json5
{
"body": "Hello @alice:example.org!",
"msgtype": "m.text",
"format": "org.matrix.custom.html",
"formatted_body": "Hello <a href='https://matrix.to/#/@alice:example.org'>Alice</a>!",
"m.mentions": {
"user_ids": ["@alice:example.org"]
}
}

Comment on lines +24 to +26
Some clients, especially bridges, might rely on the body containing the display name for a good user
experience. However, it would not be difficult to modify such a client to translate user IDs in the
message body to display names.
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this would make it impossible to send a literal MXID in body without having it transformed to the display name upon display?

It would also be a breaking change which could possibly require a new room version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
client-server Client-Server API kind:maintenance MSC which clarifies/updates existing spec needs-implementation This MSC does not have a qualifying implementation for the SCT to review. The MSC cannot enter FCP. proposal A matrix spec change proposal
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants