I'd like to add support for sticker packs to Riot. Since this would involve writing a lot of code, I wrote this little document up so we could discuss it before I've spent a long time on it. That said, while I'd love to have help, I'm happy to implement this myself.
Why sticker packs?
Most of my friends use Telegram as their chat client of choice. This isn't ideal for several reasons, and I'd like to get them to switch. It may seem silly, but I'm pretty sure the biggest lock-in factor there is stickers. Telegram's sticker system is really slick, and using anything without it or something similar feels like a real downgrade. Relatedly, I've framed most of this in comparison to Telegram's sticker system.
What makes sticker packs good?
I'd claim that the most important features are:
-
User creatable: This is nice on several levels. It saves work on the dev side, obviously. But more than that, this lets people make stickers for their specific interests.
-
Easily sendable: Stickers won't get used if it's not convenient to do so.
-
Easily copyable: Almost all the stickers I use, I have because I saw one I liked, and I added it to my collection. Telegram makes this process trivial.
-
Grouped: Part of the reason stickers spread so effectively is that if I see a sticker I like and add it to my collection, I get a bunch of other stickers along with it that I will likely enjoy.
The ideal outcome is an environment where stickers can be easily
created, and easily spread between people when they chat with each
other.
What are features we could do without?
I'm not super confident here, but:
- Updating packs. When the creator of a sticker pack adds new stickers to it, that change could be propagated out to users who have the pack, or not. I'm inclined towards not supporting that, mostly on implementation difficulty grounds. One could imagine having sticker packs label themselves as replacements for other ones, and make it easy to replace the old one if the user adds the new sticker pack, but that probably doesn’t need to be in the initial version.
Implementation
I’m proposing a specific implementation here as a proof of concept, but I’d be happy to see it improved. Mostly I’d like to get some discussion about this so I don’t spend a long time implementing this and then have it rejected.
The design goals with the implementation were:
-
Work entirely within within matrix: no external servers.
-
Avoid changes to the matrix protocol.
-
Avoid requiring the homeserver to know about stickers.
-
Avoid nonstandard messages.
This design achieves the first three. To allow subscribing to sticker packs, the fourth is compromised by adding a custom field to the image message when stickers are sent.
A sticker pack is an archive containing one or more images (stickers), and a metadata file. The metadata would associate each sticker with zero or more emoji, and contain the name of the sticker pack. It would also contain whatever information I forgot was important. Since it's likely we won't know ahead of time what information is important, we can version the spec and save the version in the metadata file. It’s unclear what file formats should be supported: that probably depends on how inline images shakes out (although this can be done with the standard image sharing until then).
To publish a sticker pack, one would:
-
Create this archive (ideally assisted by the client, but it could start out as a manual process).
-
Upload the sticker pack to your homeserver. The resulting MCX URI enables other users to subscribe (a misleading term, since it's impossible to update a sticker pack) to the sticker pack.
To subscribe to a sticker pack, the client would:
-
Download the pack using the pack's URI.
-
Save the URI in the client config. This makes subscribing to a sticker pack a a per-user, not per-device affair.
When using the pack, the client would:
-
Check to make sure all the sticker packs in the client-config exist locally. This includes deleting sticker packs that have been unsubscribed from.
-
Allow the user to easily browse and send stickers in the sticker packs.
-
When sending a sticker, include in the message the sticker pack URI. This allows other users to preview and subscribe to other sticker packs.
-
(This can be added late) If the user starts a message with an emoji, show all stickers indexed by that emoji.
Stages
I think the natural way to break this down into sub-tasks, each of which
can be implemented separately, is:
-
Implement sending (manually created) sticker packs from local storage. This is somewhat similar to Gregoor’s proposal for issue 2648. I’d be happy to coordinate with them on this.
-
(This doesn’t block anything else, it just has to come after 1) Implement a UI for creating sticker packs.
-
Synchronize a user’s sticker packs via the client-config.
-
When using a sticker from a pack, attach the link to the sticker pack.
-
Make a UI for subscribing to sticker packs you’ve seen.
I'd like to add support for sticker packs to Riot. Since this would involve writing a lot of code, I wrote this little document up so we could discuss it before I've spent a long time on it. That said, while I'd love to have help, I'm happy to implement this myself.
Why sticker packs?
Most of my friends use Telegram as their chat client of choice. This isn't ideal for several reasons, and I'd like to get them to switch. It may seem silly, but I'm pretty sure the biggest lock-in factor there is stickers. Telegram's sticker system is really slick, and using anything without it or something similar feels like a real downgrade. Relatedly, I've framed most of this in comparison to Telegram's sticker system.
What makes sticker packs good?
I'd claim that the most important features are:
User creatable: This is nice on several levels. It saves work on the dev side, obviously. But more than that, this lets people make stickers for their specific interests.
Easily sendable: Stickers won't get used if it's not convenient to do so.
Easily copyable: Almost all the stickers I use, I have because I saw one I liked, and I added it to my collection. Telegram makes this process trivial.
Grouped: Part of the reason stickers spread so effectively is that if I see a sticker I like and add it to my collection, I get a bunch of other stickers along with it that I will likely enjoy.
The ideal outcome is an environment where stickers can be easily
created, and easily spread between people when they chat with each
other.
What are features we could do without?
I'm not super confident here, but:
Implementation
I’m proposing a specific implementation here as a proof of concept, but I’d be happy to see it improved. Mostly I’d like to get some discussion about this so I don’t spend a long time implementing this and then have it rejected.
The design goals with the implementation were:
Work entirely within within matrix: no external servers.
Avoid changes to the matrix protocol.
Avoid requiring the homeserver to know about stickers.
Avoid nonstandard messages.
This design achieves the first three. To allow subscribing to sticker packs, the fourth is compromised by adding a custom field to the image message when stickers are sent.
A sticker pack is an archive containing one or more images (stickers), and a metadata file. The metadata would associate each sticker with zero or more emoji, and contain the name of the sticker pack. It would also contain whatever information I forgot was important. Since it's likely we won't know ahead of time what information is important, we can version the spec and save the version in the metadata file. It’s unclear what file formats should be supported: that probably depends on how inline images shakes out (although this can be done with the standard image sharing until then).
To publish a sticker pack, one would:
Create this archive (ideally assisted by the client, but it could start out as a manual process).
Upload the sticker pack to your homeserver. The resulting MCX URI enables other users to subscribe (a misleading term, since it's impossible to update a sticker pack) to the sticker pack.
To subscribe to a sticker pack, the client would:
Download the pack using the pack's URI.
Save the URI in the client config. This makes subscribing to a sticker pack a a per-user, not per-device affair.
When using the pack, the client would:
Check to make sure all the sticker packs in the client-config exist locally. This includes deleting sticker packs that have been unsubscribed from.
Allow the user to easily browse and send stickers in the sticker packs.
When sending a sticker, include in the message the sticker pack URI. This allows other users to preview and subscribe to other sticker packs.
(This can be added late) If the user starts a message with an emoji, show all stickers indexed by that emoji.
Stages
I think the natural way to break this down into sub-tasks, each of which
can be implemented separately, is:
Implement sending (manually created) sticker packs from local storage. This is somewhat similar to Gregoor’s proposal for issue 2648. I’d be happy to coordinate with them on this.
(This doesn’t block anything else, it just has to come after 1) Implement a UI for creating sticker packs.
Synchronize a user’s sticker packs via the client-config.
When using a sticker from a pack, attach the link to the sticker pack.
Make a UI for subscribing to sticker packs you’ve seen.