-
Notifications
You must be signed in to change notification settings - Fork 397
MSC4269: Unambiguous mentions in body #4269
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -0,0 +1,52 @@ | ||||||||||||||||||||||||||
# MSC4269: Unambiguous mentions in body | ||||||||||||||||||||||||||
|
||||||||||||||||||||||||||
The use of display names makes it difficult to parse user mentions from a message body. Clients can | ||||||||||||||||||||||||||
also make it difficult to type user IDs without having them replaced with a mention. | ||||||||||||||||||||||||||
|
||||||||||||||||||||||||||
Some clients, such as bots, have no use for or do not want to deal with the complexity of parsing | ||||||||||||||||||||||||||
the pseudo-HTML of the `formatted_body`. In addition, the `m.mentions` added by [MSC3952] is not | ||||||||||||||||||||||||||
enough, either, as the listed user IDs lack the context of the message body. | ||||||||||||||||||||||||||
|
||||||||||||||||||||||||||
Translating the display names in the message body back to user IDs is difficult, if not impossible. | ||||||||||||||||||||||||||
However, the reverse operation - translating unambiguous user IDs in the body into display names - | ||||||||||||||||||||||||||
is trivial in comparison. | ||||||||||||||||||||||||||
|
||||||||||||||||||||||||||
Thus it is proposed that the message `body` should contain user IDs instead of display names. | ||||||||||||||||||||||||||
|
||||||||||||||||||||||||||
## Proposal | ||||||||||||||||||||||||||
|
||||||||||||||||||||||||||
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. | ||||||||||||||||||||||||||
|
||||||||||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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
|
||||||||||||||||||||||||||
## Potential issues | ||||||||||||||||||||||||||
|
||||||||||||||||||||||||||
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. | ||||||||||||||||||||||||||
Comment on lines
+24
to
+26
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 It would also be a breaking change which could possibly require a new room version. |
||||||||||||||||||||||||||
|
||||||||||||||||||||||||||
## Alternatives | ||||||||||||||||||||||||||
|
||||||||||||||||||||||||||
- Change the spec so that the anchor's text component is the user ID. It would make user mentions | ||||||||||||||||||||||||||
more consistent with room mentions. This changes the `formatted_body` as well, potentially | ||||||||||||||||||||||||||
requiring more changes to clients. | ||||||||||||||||||||||||||
|
||||||||||||||||||||||||||
- Specify the use of markdown links in the `body` matching the anchors in the `formatted_body`. | ||||||||||||||||||||||||||
While easier to parse, it's not as simple as just the user ID. | ||||||||||||||||||||||||||
|
||||||||||||||||||||||||||
- Bracket display names in the `body` somehow, making it possible to look them up, perhaps with the | ||||||||||||||||||||||||||
help of `m.mentions`. However, they remain ambiguous. | ||||||||||||||||||||||||||
|
||||||||||||||||||||||||||
## Security considerations | ||||||||||||||||||||||||||
|
||||||||||||||||||||||||||
None. | ||||||||||||||||||||||||||
|
||||||||||||||||||||||||||
## Unstable prefix | ||||||||||||||||||||||||||
|
||||||||||||||||||||||||||
None. | ||||||||||||||||||||||||||
|
||||||||||||||||||||||||||
## Dependencies | ||||||||||||||||||||||||||
|
||||||||||||||||||||||||||
None. | ||||||||||||||||||||||||||
|
||||||||||||||||||||||||||
[MSC3952]: https://github.com/matrix-org/matrix-spec-proposals/pull/3952 |
There was a problem hiding this comment.
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.