-
Notifications
You must be signed in to change notification settings - Fork 400
MSC4144: Per-message profiles #4144
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?
Conversation
Signed-off-by: Tulir Asokan <tulir@beeper.com>
This comment was marked as resolved.
This comment was marked as resolved.
Implementing encrypted avatars could cause difficulty for clients that assume | ||
that avatars are always unencrypted mxc URIs. | ||
|
||
## Alternatives |
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.
Reminds me of MSC3464. This is more general than that MSC, though.
{ | ||
"msgtype": "m.text", | ||
"body": "Hello, World!", | ||
"m.per_message_profile": { |
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.
I wonder if with extensible messages, it would make sense to support the (horrible) format of {name}: {body}
. E.g.
{
"msgtype": "m.text",
"body": "Hello, World!",
"m.text": [
{ "body": "<strong>cat</strong>: Hello, world", "mimetype": "text/html" },
{ "body": "cat: Hello, world" }
],
"m.per_message_profile": {
"id": "meow",
"displayname": "cat",
"avatar_url": "mxc://maunium.net/hgXsKqlmRfpKvCZdUoWDkFQo"
}
}
as currently the fallback for unsupported clients isn't great.
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.
That might cause ptsd from reply fallbacks 😹 Maybe it is the best option though. Needs very strict rules to ensure the fallback can always be safely stripped out. An indicator for whether the fallback is present at all is probably also a good idea.
I don't think extensible events would help at all unless you duplicated the entire message (one copy with a fallback and another without), but duplication is also bad
Perhaps something along the lines of
{
"msgtype": "m.text",
"body": "cat: Hello, World!",
"format": "org.matrix.custom.html",
"formatted_body": "<strong data-mx-profile-fallback>cat: </strong>Hello, World!",
"m.per_message_profile": {
"id": "meow",
"displayname": "cat",
"avatar_url": "mxc://maunium.net/hgXsKqlmRfpKvCZdUoWDkFQo",
"has_fallback": true
}
}
where if has_fallback
is true, body
MUST be prefixed with the exact value of displayname, followed by a colon and a space, and formatted_body
(if present) MUST have the same prefix inside a strong
tag with the data-mx-profile-fallback
attribute
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.
Having the has_fallback flag would make the change fully compatible with all existing per-message profile messages and it would allow removing it in the future like reply fallbacks
The HTML version might have to allow not being the prefix, because otherwise it wouldn't really work with paragraph tags (you'd get a forced linebreak if you did something like <strong data-mx-profile-fallback>cat: </strong><p>message text</p>
). A HTML parser should still be able to just drop anything with the data-mx-profile-fallback
attribute and it might be reasonably safe to regex too because there won't be any html inside like there were in reply fallbacks
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.
I have added fallbacks as per my example above to the MSC
Rendered
Implementations:
Signed-off-by: Tulir Asokan tulir@beeper.com