Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
MSC2545: Image Packs (Emoticons & Stickers) #2545
base: old_master
Are you sure you want to change the base?
MSC2545: Image Packs (Emoticons & Stickers) #2545
Changes from 28 commits
bc55ff6
0f4bd5e
2d191f6
fa3a8be
96f2864
81ccecb
dc43e79
4435d75
79aae8a
4fea69b
0e382e0
72b2174
2e2987b
e8c2e34
b41c091
4f6d147
5351cb3
12c8fa8
e8d910f
a879bcd
580a836
43f20ad
739b4c0
51bcec2
71a3c55
a7a4a36
be7d0df
b5ca351
3517a16
5d62d52
e5b9c2c
44c5ed3
ea50cc7
3c2e29c
c429552
d4e9cd2
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Since this MSC will intersect with MSC3911, I think we should consider this blocked until MSC3911 (or some other solution to the issues solved by that MSC) is merged.
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'm not sure this has to be blocked on MSC3911 - MSC2545 is already in use in the wild all over the place. MSC3911 will need to figure out how to address it, but not block the whole of this on media linking/auth.
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.
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.
also, we need consequences listed: does the event not get rendered, or just the emoticon?
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've applied the suggestion in the first comment in a separate commit.
I don't see why the rest of the event should not be rendered. It'd be ideal to still be able to see the text in a message, even if the emotes aren't formatted properly (and are thus not rendered). Do you agree?
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 it's worth allowing implementations to create their own usages, in which case, we probably want the usages to be
m.emoticon
andm.sticker
, and have the custom usages follow the Java package naming convention as usual.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 feel the usual spec process of being able to add unstable prefixes to values in this field is sufficient? The current wording doesn't prevent that.
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.
Agreed. It just seems to me like naming it
m.emoticon
instead of justemoticon
makes it easier and clearer. Anyways, it's a non-blocking comment.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.
Has anyone seen any use cases for additional "usages" in the wild while this MSC has been implemented? @deepbluev7 perhaps?
If not, perhaps it's just best to leave this as is.
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.
There was an in-person discussion about this with a few folks at The Matrix Conference 2024 (which included @deepbluev7!).
One client developer (can anyone remember who?) complained that implementation of
usage
as a pack-level field complicated their UI. They wanted one tab of the room's settings dedicated to "Emotes", and another dedicated to "Stickers". This is a common paradigm in other chat apps, i.e. Discord:However if one pack has
"usage": ["emoticon", "sticker"]
, then changing the pack under theEmotes
tab would silently modify the same pack underStickers
.The developer proposed the idea of only allowing a single
usage
per pack, to eliminate this quirk.On the other hand, @deepbluev7 argued that they liked being able to import a pack containing both emotes and stickers at the same time. Perhaps there could be no usage field at all; any pack you import can immediately be used for both stickers and emotes.
Nobody had any additional use cases to suggest for the
usages
field.The idea of having a
usages
field per-image was also floated, though I don't personally recall what problem this solved.We should be considering the end-user experience when designing this feature. I can see users expecting to configure emoji and stickers in separate screens in a client, similar to Slack and Discord, and end up confused if editing one silently edits the other.
In addition, how common is it that a user wants to start using images from a sticker pack as an emoticon or vice versa? A client could make it simple for a user to convert a sticker pack into an emoticon pack, and this could be handled under the hood. But having one pack serve both functions is confusing, in my opinion, for users coming from other messaging platforms.
I propose that we then eliminate the
usages
field at both the pack and individual image level, and replace it with ausage
string field at the pack level that is either "emoticon" or "sticker". (Having a newusage
field instead of re-usingusages
allows for backwards-compatibility with older implementations of this proposal. New clients can treat old events with ausages
field containing a single value as the same meaning as the equivalentusage
field. Packs containingusages
with both values... TODO).I can foresee the argument that this effectively requires a duplicate state event for a pack that wants to be used for both stickers and emoticons. However I think the more familiar end-user experience is worth it.
(N.B. nothing prevents a client from still being able to use emoticon or sticker packs for the other purpose if a developer/user wished. The
usage
field is merely a suggestion to a user's client.)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 was me
What does "import" mean exactly here? from some kind of export format?
I guess nothing stops one from having both stickers and emoticons in the same "export file" and importing both simultaneously
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'm not sure that de-duplicating images is the best UI. If there is an image that appears in two image packs, and I'm used to picking that image from pack 1, but the client only displays it in pack 2, then I won't be able to find the image that I want.
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.
It also makes it more difficult to manage packs, in case you want to manually remove duplicates.
Perhaps it would make more sense to only de-duplicate packs themselves?
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.
Also, less relevant and only marginally importnat, but assuming you can click on a sticker to view it's name in the chat like you can with discord stickers/emojis, that should probably be taken into account.
So if you have a smug/grimacing face in one pack titled "I'm gonna get u" and the same sticker in another pack titled "satisfied", you could potentially want to send the different stickers in different rooms, on the assumption that people are gonna click and read the name. And you'll probably search the sticker by the name you intend to convey.
Whether people actually use emojis/stickers like that is up to debate, but hey, I like naming my emoji nicely in discord, so I can kind of see it.
If de-duplicating is "automatic", then don't know if it's really even necessary. I don't see why a user shouldn't be able to just put 400 of the same sticker in their own pack if they wanted to. They probably won't anyway, buf if they do it as a joke, who cares. Feels like slightly wasted development time to me to put an arbitrary restriction.
A button to remove duplicates in the pack on demand sounds cool though, makes life easier if you just have a big sticker folder that might have a few repeating images, e.g. from downloading/collecting stickers you see manually.
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.
Good idea, though this can be implemented in the client. The current spec won't get in the way of such a client feature.
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.
@deepbluev7 What are your thoughts on this, given your experience with implementing this MSC?
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.
There was an in-person discussion about this with a few folks at The Matrix Conference 2024 (which included @deepbluev7!). The conclusion was that de-duplicating packs is not simple, as you need to check whether two packs are equivalent.
You cannot use the event ID, as it will be different across rooms (even if someone has copied a pack from one room to another). You could check whether the same images are in each pack, but if one pack is updated to add/room one image, then the two packs are no longer equivalent.
Even if two packs contain the same set of images, those images could have been re-uploaded to another homeserver, meaning the MXC URIs are not comparable!
Thus, attempting to de-duplicate packs is fragile. We'd rather not de-duplicate, than create a confusing user experience by only de-duplicating some packs.
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 think one could equally well argue the opposite. Given that matrix events are limited to 65536 bytes, and each image is going to be 1000 bytes or so (counting the URL and the imageinfo), you're not going to fit many images in an event.
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 had a go at calculating a rough estimate of how many images (as defined by this MSC) you could fit into a single 65535 byte state event: /~https://github.com/anoadragon453/emote-estimate
The result was ~400 emotes per pack. This actually seems fairly tolerable for every day usage, especially as Discord has a maximum of 250 emotes per server (assuming you pay for that limit bump).
The main concern I can see is bridging; Slack seemingly lets you have infinite custom emoji per workspace, so a bridge would need to split that up into multiple packs, which may look a little ugly in the UI.
But my opinion is that 400 emotes is fine for now, and people are getting along with the current limits. A future MSC could add a method for merging image packs defined in separate state events together, but I don't think the current limit is a blocker.