-
Notifications
You must be signed in to change notification settings - Fork 411
MSC4356: Recently used emoji #4356
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
Open
Johennes
wants to merge
4
commits into
matrix-org:main
Choose a base branch
from
Johennes:johannes/recent-emoji
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+74
−0
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
# MSC4356: Recently used emoji | ||
|
||
Like other chat platforms, Matrix supports emoji as a way to visually express ideas or emotions. In | ||
practice, most people use a limited set of emoji only. Since emoji are commonly used as a quick way | ||
to react to something, it is desirable for clients to offer users shortcuts to their favorite emoji. | ||
Some emoji picker libraries support this feature by locally tracking emoji usage. This doesn't work | ||
well in a multi-device environment, however, because such history cannot easily be shared between | ||
clients. | ||
|
||
This proposal introduces a way for clients to maintain a shared storage of recently used emoji to | ||
enable emoji suggestions across clients. | ||
|
||
## Proposal | ||
|
||
A new global account data event `m.recent_emoji` is introduced. In `content`, it contains a single | ||
property `recent_emoji` that is an array where each element is itself an array. The first element in | ||
this nested array is the emoji, the second element is a counter (\<= 2^53-1) for how often it was | ||
used. The outer `recent_emoji` array is ordered descendingly by last usage time. | ||
|
||
``` json5 | ||
{ | ||
"type": "m.recent_emoji", | ||
"content": { | ||
"recent_emoji": [ | ||
[ "😅", 7 ], // Most recently used, 7 times overall | ||
[ "👍", 84 ], // Second most recently used, 84 times overall | ||
... | ||
} | ||
} | ||
``` | ||
|
||
When an emoji is used in a message or an annotation, the sending client moves (or adds) it to the | ||
beginning of the `recent_emoji` array and increments (or initializes) its counter. | ||
Johennes marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
When an image is sent as an inline image or in a reaction (using [MSC4027]), the `mxc://` URI of the | ||
image MAY be used as the "emoji" in this event. Clients which do not support such use of images MUST | ||
tolerate the existence of `mxc://` entries, e.g. by ignoring the entries when deciding what to | ||
display to the user, while still preserving them when modifying the list. | ||
|
||
As new emoji are being used, clients SHOULD limit the length of the `recent_emoji` array by dropping | ||
elements from the end. A RECOMMENDED maximum length is 100 emoji. Apart from this, no other | ||
mechanism for resetting counters is mandated as the upper boundary of 2^53-1 seems sufficiently | ||
large for all practical purposes. | ||
|
||
Clients MAY freely customise the logic for generating recommendations from the stored emoji. As an | ||
example, they could select the 24 first (= most recently used) emoji and stably sort them by their | ||
counters (so that more recently used emoji are ordered first on ties). | ||
|
||
## Potential issues | ||
|
||
Clients could choose wildly different ways to generate recommendations from the shared storage | ||
leading to significantly different UX across clients. | ||
|
||
## Alternatives | ||
|
||
Further metadata such as the concrete access time or the room could be tracked together with emoji. | ||
It is unclear, however, if this would lead to materially better suggestions, however. | ||
|
||
## Security considerations | ||
|
||
This proposal doesn't mandate encrypting the `m.recent_emoji` account data event. Since emoji are | ||
most commonly used in annotations which are not encrypted, servers could already track and abuse | ||
this information today, however. | ||
|
||
## Unstable prefix | ||
|
||
While this MSC is not considered stable, `m.recent_emoji` should be referred to as | ||
`io.element.recent_emoji`. | ||
|
||
## Dependencies | ||
|
||
None. | ||
|
||
[MSC4027]: https://github.com/matrix-org/matrix-spec-proposals/pull/4027 |
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.
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 know that the plural form of
emoji
can beemoji
but to avoid confusion, maybe usingm.recent_emojis
help to clarify that we have a list of emojis?