Skip to content
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

Open
wants to merge 36 commits into
base: old_master
Choose a base branch
from
Open
Changes from 3 commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
bc55ff6
add emotes proposal
Sorunome May 15, 2020
0f4bd5e
add more stuffs
Sorunome May 15, 2020
2d191f6
fix naming thingy
Sorunome May 15, 2020
fa3a8be
fix typo
Sorunome May 15, 2020
96f2864
outline room emote packs and emote rooms
Sorunome May 20, 2020
81ccecb
remove comma
Sorunome May 20, 2020
dc43e79
address things
Sorunome May 20, 2020
4435d75
update emotes msc
Sorunome Jun 20, 2020
79aae8a
update
Sorunome Jun 20, 2020
4fea69b
Fix typos and grammar mistakes
Sorunome Jun 24, 2020
0e382e0
m.emote --> m.emoticon, update dedupe and pack priority
Sorunome Sep 1, 2020
72b2174
update stuff
Sorunome Sep 24, 2020
2e2987b
add a paragraph over emojis and stuff
Sorunome Sep 30, 2020
e8c2e34
Re-word proposal to sound more firm, address lots of suggestions
Sorunome Oct 25, 2020
b41c091
specify that emotes can be animated
Sorunome Oct 25, 2020
4f6d147
update msc to also include stickers and thelike
Sorunome Mar 25, 2021
5351cb3
update a few things
Sorunome Mar 25, 2021
12c8fa8
add a few more words on slugs
Sorunome Mar 25, 2021
e8d910f
Update proposals/2545-emotes.md
Sorunome Mar 26, 2021
a879bcd
license --> attribution
Sorunome Jul 4, 2021
580a836
Update proposals/2545-emotes.md
Sorunome Jul 18, 2021
43f20ad
Merge branch 'soru/emotes' of github.com:Sorunome/matrix-doc into sor…
Sorunome Jul 18, 2021
739b4c0
Update with "looking further" section and slightly update comparison
Sorunome Jul 18, 2021
51bcec2
add a sentance to suggest image packs from spaces
Sorunome Jul 24, 2021
71a3c55
soru bamboozled herself!
Sorunome Jul 24, 2021
a7a4a36
Fix small wording and ensure that emotes from canonical spaces are to…
Sorunome Sep 16, 2021
be7d0df
Update spelling mistakes and wording, only suggest deduplication meth…
Sorunome Oct 28, 2022
b5ca351
fix some typos
anoadragon453 Sep 19, 2023
3517a16
Make reference to spec/client naming disparity timeless
anoadragon453 Aug 15, 2024
5d62d52
Require `alt` and `title` attributes for emotes
anoadragon453 Aug 15, 2024
e5b9c2c
Link `m.sticker` spec; small wording changes
anoadragon453 Aug 15, 2024
44c5ed3
Prevent clients from rendering emotes behind non-MXC uri schemes
anoadragon453 Aug 15, 2024
ea50cc7
Clarify client requirements around emote resolution
anoadragon453 Aug 15, 2024
3c2e29c
Add a new proposal intro
anoadragon453 Aug 15, 2024
c429552
Recommend default of 32px for emote height
anoadragon453 Aug 28, 2024
d4e9cd2
Specify image formats are equivalent to m.image
anoadragon453 Aug 29, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
67 changes: 67 additions & 0 deletions proposals/2545-emotes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# MSC2545: Emotes
Sorunome marked this conversation as resolved.
Show resolved Hide resolved
Sorunome marked this conversation as resolved.
Show resolved Hide resolved
Sorunome marked this conversation as resolved.
Show resolved Hide resolved

Emotes.....emotes!

# Proposal
Emotes have at least a shortcode and an mxc uri. They are sent as `<img>` tags currently already in
the spec, as such existing clients *should* be able to render them (support for this is sadly poor,
even within riot flavours). Such an `<img>` tag of a shortcode `:emote:` and an mxc uri `mxc://example.org/emote`
could look as follows:

```html
<img src="mxc://example.org/emote" alt=":emote:" title=":emote:" height="32" />
```

Both the `alt` and the `title` attributes are specified as they serve different purposes: `alt` is
displayed if e.g. the emote does not load. `title` is displayed e.g. on mouse hover over the emote.
Sorunome marked this conversation as resolved.
Show resolved Hide resolved
The height is just a height that looks good on most devices with the normal, default font size.
No width is displayed as to not weirdly squish non-square emotes.
Sorunome marked this conversation as resolved.
Show resolved Hide resolved

## Emote sources
In order to be able to send emotes the client needs to have a list of shortcodes and their corresponding
mxc uris. For this there are two different emote sources:

### User emotes
User emotes are per-user emotes that are defined in the users respective account data. The type for that
Sorunome marked this conversation as resolved.
Show resolved Hide resolved
is `im.ponies.user_emotes`. The content is as following:
Sorunome marked this conversation as resolved.
Show resolved Hide resolved

```json
{
"short": {
":emote:": "mxc://example.org/blah",
":other-emote:": "mxc://example.org/other-blah"
}
}
```

The emotes are defined inside of a dict called `short`, meant as the "short and easy" representation
Sorunome marked this conversation as resolved.
Show resolved Hide resolved
of the emotes. Other, additional, keys may exist to define more metadata for the emotes. No such
Sorunome marked this conversation as resolved.
Show resolved Hide resolved
guide exists yet.

### Room emotes
Room emotes are per-room emotes that every user of a specific room can use inside of that room. They
Sorunome marked this conversation as resolved.
Show resolved Hide resolved
are set with a state event of type `im.ponies-room_emotes` and a blank state key. The contents are
Sorunome marked this conversation as resolved.
Show resolved Hide resolved
the same as for the user emotes.

## Sending
In places where fancy tab-complete with the emote itself is not possible it is suggested that sending
the shortcode will convert to the img tag, e.g. sending `Hey there :wave:` will convert to `Hey there <img-for-wave>`.
Sorunome marked this conversation as resolved.
Show resolved Hide resolved

If there are collisions due to the same emote shortcode being present as both room emote and user emote
a user could specify the emote source by writing e.g. `:room~wave:` or `:user~wave:`. Other sources
could perhaps be added, see ideas section.

# Ideas
- Tag rooms as "these emotes can be used anywhere" inside of account data somehow
Sorunome marked this conversation as resolved.
Show resolved Hide resolved
- Some kind of packs - for room emotes the state key could be used as pack identifier, for user
emotes something like `im.ponies.user_emotes.<pack_name>`.

# Current implementations
## Emote rendering (rendering of the `<img>` tag)
- riot-web
- revolution
- nheko
- fluffychat
## Emote sending, using the mentioned events here
- revolution
- fluffychat