Skip to content

New plugin: Stickers

This plugin implements XEP-0449 and allows the user to send and receive stickers. Sticker packs that are not published on the user's account can be uploaded and published on sign-in, if configured. The same holds true for stickers that are published on the user's account but not locally present, except that they are downloaded on sign-in. Animated stickers, though currently only GIFs, are also supported with the ability to turn off animations.

stickers_chat

The button that shows a menu for selecting the sticker to send is also searchable and updates when a new sticker pack gets added. It searches for matchin in either a sticker's "description" (desc) or one of its "suggests".

stickers_popup

When a sticker is not known, the sticker pack gets automatically downloaded and added. This, however, can be turned off. In that case, a button is shown that asks the user if the sticker pack should be downloaded.

stickers_manual

As just deleting the folder containing the sticker pack does not delete it from the account, this plugin also features a UI for removing sticker packs:

stickers_list

There are, however, currently two problems:

  • The stickers are always sent unencrypted. At least with OMEMO, all non-whitelisted tags are filtered out before sending.
  • As a rework of the conversation view is currently in progress, I would have to rewrite the plugin a bit when that MR is merged.

I should note that the plugin does not support importing or creating sticker packs. For my testing purposes I have created a script that takes a JSON representation of a sticker pack - that this plugin uses internally - and updates it so that the plugin can work with it. I feel like it is out of scope of the plugin, or at least of this first MR.

Under Linux the plugin requires stickers to be located at ~/.local/share/gajim/plugins_data/stickers/<sticker pack ID>/<sticker file>. The folder must contain a info.json file that describes the sticker pack and looks like this:

{
  "id": "0c58051a78fcd4ecf982f136",
  "name": "A sticker pack",
  "summary": "A description",
  "stickers": [
    {
      "type": "image/png",
      "hashes": [
        {
          "algo": "sha-256",
          "value": "8b76e01a4cd9ef8b3d63541459b1718b62c6073271b4e14cd0a9d3155964f13b"
        }
      ],
      "size": "14015",
      "dimension": "113x110",
      "desc": ":grin:",
      "suggests": [":blobgrin:"],
      "filename": "grin.png",
      "url": ""
    },
    [...]
  ]
}

The URL attribute of a sticker can be left empty as the plugin updates it automatically when the sticker pack has been published.

I tested this plugin on two Linux machines and it works. It requires a Gajim version newer than a290db02.

Merge request reports