Stickers

Stickers are image files that are sent between clients and displayed inline at a consistent size much larger than emoticons. They are selected from a popup or special keyboard, and do not replace text such as :) or ☺ or :smile:. Stickers are different from emoticons in this way.

Benefits of stickers over emoticons and emoji are outlined here: https://github.com/irungentoo/toxcore/issues/1106

You can read more about stickers on Wikipedia: https://en.wikipedia.org/wiki/Sticker_(Internet)

This page is a sounding board for the technical implementation of stickers, how they're stored and accessed, and the ways users should be able to interact with them. When the spec is finalized it will be included in clients.

Developers and designers, please contribute.

User-Facing Behavior

Graphical mockup of sticker menu.

Proposal for popup menu design from https://github.com/tux3/qTox/issues/1294

Sending/In the Popup

Stickers should be selectable from a popup menu in desktop clients and from a modified keyboard when a software keyboard is in use (See the Facebook mobile app for reference).

Tox clients will come with a decent amount of default sticker packs. There should be a way to Manage sticker packs and disable them, hiding them from the list until reenabled (deleting them completely should not be too easy.)

Animated stickers in the popup should play when hovered over. In the sticker keyboard, stickers that are held down should appear (and play, if animated) above the keyboard with the rest of the interface dimmed or blurred. If the user moves their finger the sticker being previewed should change to whichever one they're touching. Stickers should not be sent when released.

There should be some way in the UI to display the contents of a tiny about.txt file listing credits and possibly license information.

When a sticker is clicked or tapped, it is sent immediately and appears inline in the chat form.

Receiving/In the Chat Form

Animated stickers should play as long as they are the most recent sticker in the conversation. After that, they should play when hovered over. On touch devices, tapping takes the place of hovering.

Saving/Sharing

Right-clicking or long-pressing (or whatever platform action is appropriate) on a sticker should bring up a context menu where users can opt to Get this Pack, at which point the pack corresponding to the sticker they selected will be downloaded from their friend and added to their collection. The option to get a pack will only appear if they don't already have it.

Users should be able to download a Tox sticker pack from the internet and import it from their Tox client's sticker popup. If they move a pack into the proper location in the filesystem it should also be recognized and immediately ready for use.

Technical Implementation

This includes the format in which sticker packs are stored (I vote for zipped folders with custom extension), the location, how we should detect if a user has a pack already, how animation should be done (svg spritesheets would be beautiful but might have to be NIHed, gifs are terrible but everyone knows them, webm is best but hard to make [maybe release a converter as a part of the Tox StickerMaker Premium Suite], >apng), etc

Keep in mind the potential of the Tox sticker pack to become an open sticker format usable by all free software, like the KDE emoticon packs used by qTox.

Sending

Once a sticker is selected by the user, it should be sent as a file transfer of TOX_FILE_KIND_STICKER with the name being a hash of its content path name something. Discussion needed.

Receiving

When a client receives a sticker file transfer request, it first checks if that hash is already in the cache. If it is, the file transfer is denied and the cached sticker is used instead. This mechanism addresses bandwidth concerns on mobile devices.

Storage

Packs

A Sticker Pack is a zipped folder containing stickers, an about.txt, and a pack.png/svg/etc. The Sticker Packs are what appear in the client's sticker-sending popup. This is the user's collection of stickers. Sticker filenames end with numbers, according to the order they should be displayed in.

  ~/.config/tox/stickers/packs/
   |
   |--Orange Cat.zip
   |   |
   |   |--pack.svg
   |   |--about.txt
   |   |--grin_1.svg
   |   |--heart_eyes_2.svg
   |   `--kiss_3.svg
   |
   `--pack_2.zip
       |
       |--pack.png
       |--about.txt
       |--sticker_1.png
       |--sticker_2.png
       `--sticker_3.png
       

The file about.txt contains information about the pack. Should we make it an ini and do real metadata or nah?

The file pack.png/svg/etc is an image used as the thumbnail of the pack as displayed in the client's sticker popup.

Cache

The Sticker Cache is a directory that contains all received stickers, stored flatly.

  ~/.config/tox/stickers/cache/
   |
   |--hash.svg
   |--hash.png
   |--hash.gif
   `--hash.svg
   

It would be neat to prune/retain stickers from the cache based on how often they're received

Getting

When a user opts to download a sticker pack from a friend, a file transfer should be initiated and the sticker pack should be automatically saved to the correct location.

Print/export