Skip to content

Commit 35e6d3b

Browse files
committed
MSC4269: Unambiguous mentions in body
Signed-off-by: Jan Alexander Steffens (heftig) <[email protected]>
1 parent 3f3b34a commit 35e6d3b

File tree

1 file changed

+51
-0
lines changed

1 file changed

+51
-0
lines changed

Diff for: proposals/4269-unambiguous-mentions-in-body.md

+51
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# MSC4269: Unambiguous mentions in body
2+
3+
The use of display names makes it difficult to parse user mentions from a message body. Clients can
4+
also make it difficult to type user IDs without having them replaced with a mention.
5+
6+
Some clients, such as bots, have no use for or do not want to deal with the complexity of parsing
7+
the pseudo-HTML of the `formatted_body`. In addition, the `m.mentions` added by [MSC3952] is not
8+
enough, either, as the listed user IDs lack the context of the message body.
9+
10+
Translating the display names in the message body back to user IDs is difficult, if not impossible.
11+
However, the reverse operation - translating unambiguous user IDs in the body into display names -
12+
is trivial in comparison.
13+
14+
Thus it is proposed that the message `body` should contain user IDs instead of display names.
15+
16+
## Proposal
17+
18+
The specified client behavior for user and room mentions is modified so that the event's `body`
19+
should contain the unambiguous user ID, canonical room alias or room ID instead of the anchor's
20+
text component.
21+
22+
## Potential issues
23+
24+
Some clients, especially bridges, might rely on the body containing the display name for a good user
25+
experience. However, it would not be difficult to modify such a client to translate user IDs in the
26+
message body to display names.
27+
28+
## Alternatives
29+
30+
- Change the spec so that the anchor's text component is the user ID. It would make user mentions
31+
more consistent with room mentions. This changes the `formatted_body` as well.
32+
33+
- Specify the use of markdown links in the `body` matching the anchors in the `formatted_body`.
34+
While easier to parse, it's not as simple as just the user ID.
35+
36+
- Bracket display names in the `body` somehow, making it possible to look them up, perhaps with the
37+
help of `m.mentions`. However, they remain ambiguous.
38+
39+
## Security considerations
40+
41+
None.
42+
43+
## Unstable prefix
44+
45+
None.
46+
47+
## Dependencies
48+
49+
None.
50+
51+
[MSC3952]: https://github.com/matrix-org/matrix-spec-proposals/pull/3952

0 commit comments

Comments
 (0)