File metadata element (XEP-xxxx) XEP-xxxx: File metadata element <https://xmpp.org/extensions/inbox/file-metadata.html>." > Stateless file sharing (XEP-xxxx) XEP-xxxx: Stateless file sharing <https://xmpp.org/extensions/inbox/sfs.html>." > %ents; ]>
Stickers This specification provides a protocol to send stickers and to create and share sticker packs. &LEGALNOTICE; 0449 Experimental Standards Track Standards Council XMPP Core XEP-0001 stickers &larma; 0.1.0 2020-11-24 XEP Editor (jsc) Accepted by vote of Council on 2020-11-18. 0.0.1 2020-11-03 lmw

First draft.

StickersSticker (messaging) on Wikipedia <https://en.wikipedia.org/wiki/Sticker_(messaging)>. are images or short animations that often represent an emoticon or an action. They are increasingly used in private messaging in the last years, especially on mobile phone apps. Stickers can be more nuanced and expressive than emoticons. They can be used to convey emotions or tell stories in a fun and easy way.

Recently, demand to implement stickers, including their social feature of sharing sticker packs arised within the XMPP community. This specification is to fulfill this demand.

Sticker
Emoticon-like picture
Sticker pack
Collection of stickers, typically devoted to a specific theme or with all stickers created by the same author

Sticker packs are stored on pubsub nodes. They SHOULD be located at a personal eventing (PEP) node named "urn:xmpp:stickers:0" but MAY be located at a generic publish-subscribe node that is not attached to a user's IM account. The pubsub node's access model SHOULD be set to 'open', so that other users can fetch sticker packs.

Each sticker pack is one item on the pubsub node consisting of a <pack/> element.

The <pack/> element includes elements <name/> and <summary/> to announce a name and summary of the sticker pack that can be displayed to users, respectively. The summary MAY contain copyright and license information in user-readable format. Multiple <name/> and <summary/> elements MAY be included given that no two elements of same name specify the same xml:lang.

The <pack/> element MAY include a <restricted/> element to indicate that this sticker pack may not be used or imported by other users.

The <pack/> element contains one or more <item/> elements that include details on the stickers in the pack. Each <item/> element has <file/> element as described in &xep-file-metadata;. The metadata MUST include one or multiple <hash/> elements as described in &xep0300;. All stickers in a pack MUST use the same algorithm for their <hash/> elements. The metadata MUST include one <desc/> element that is not qualified by a xml:lang attribute and describes the textual fallback (often an emoji or a sequence of emojis) of the sticker. Each <item/> element further has a <sources/> element as described in &xep-sfs; describing how to retrieve the image file of the sticker. Each <item/> element MAY include one or more <suggest/> elements that include a text that clients may replace with the sticker. <suggest/> elements MAY have an xml:lang attribute.

Finally, the <pack/> element includes a single <hash/> element as described in &xep0300;, specifying the hash of the sticker pack. See next section on how such hash is generated.

Each sticker pack has a unique ID, which is used as the pubsub item's id. This ID is derived from a hash of significant information from a <pack/> element as outlined in this section.

  1. Processing <name/> and <summary/> elements:

    1. For each <name/> or <summary/> element:

      1. Encode the character data of element name (name or summary), xml:lang attribute value and content.
      2. Append an octet of value &sepl4; to each resulting octet string.
      3. Join the resulting octet strings together, in the order of element name, xml:lang attribute and content, resulting in a single octet string for the <name/> or <summary/> element.
      4. Append an octet of value &sepl3;.
    2. Join the resulting octet strings together, ordered from lesser to greater.
    3. Append an octet of value &sepl1;.

    The result of this step is referenced as Meta string later.

  2. Processing <item/> elements:

    1. For each <item/> element:

      1. Encode the character data of <file/>'s <desc/> content.
      2. Append an octet of value &sepl3; to the resulting octet string.
      3. For each of <hash/> element in <file/>:

        1. Encode the character data of algo attribute and content.
        2. Append an octet of value &sepl4; to the resulting octet strings.
        3. Join the resulting octet strings together, in the order of algo attribute and content, resulting in a single octet string for the <hash/> element.
        4. Append an octet of value &sepl3;.
      4. Join the resulting octet strings together, in the order of <file/>'s <desc/> content first and then all <hash/> elements ordered from lesser to greater.
      5. Append an octet of value &sepl2;.
    2. Join the resulting octet strings together, ordered from lesser to greater.
    3. Append an octet of value &sepl1;.

    The result of this step is referenced as Stickers string later.

  3. Join the Meta String and Stickers String together, in this order.
  4. Hash the resulting string using the algorithm choosen for the sticker pack.

The ID of the sticker pack is dervied by taking the first 144 bit of the hash and encode it using Base64. This is equivalent to the first 24 characters of the Base64 encoded content of the <hash/> element.

Marsey the Cat Be cute or be cynical, this little kitten works both ways. image/png 👍 71045 512x512 0AdP8lJOWJrugSKOIAqfEKqFatIpG5JBCjjxY253ojQ= +1 image/png 😘 67016 512x512 gw+6xdCgOcvCYSKuQNrXH33lV9NMzuDf/s0huByCDsY= EpRv28DHHzFrE4zd+xaNpVb4jbu4s74XtioExNjQzZ0= ]]>

The sending entity uses &xep-sfs; to send the image file from the sticker pack. The <item/>'s <file/> and <sources/> elements from the sticker pack are used as a template. The sending entity MAY add additional <hash/> elements or sources.

Additionally, the sending entity adds an element <sticker/> to the message. This element carries an attribute pack referring to the id of the pubsub item carrying the sticker pack. If the sticker pack resides on a pubsub item other than the senders personal eventing (PEP) node named "urn:xmpp:stickers:0", the sending entity must add additional attributes jid and node, referring to the jid of the pubsub node and the name of the node, respectively.

The sending entity SHOULD use the <file/>'s <desc/> content as the message body, except if the sticker was selected based on a suggestion, in which case the content of the corresponding <suggest/> SHOULD be used.

😘 image/png 😘 67016 512x512 gw+6xdCgOcvCYSKuQNrXH33lV9NMzuDf/s0huByCDsY= ]]>

When receiving a message with a <sticker/> element, the receiving entity SHOULD consider the message and the <file-sharing/> element as a sticker.

When receiving a sticker, the receiving entity may display the stickers image file inline or display the textual representation in the <desc/> element. The receiving entity SHOULD NOT display the received sticker only as a downloadable file.

When receiving a sticker or any other reference to a sticker pack, the receiving entity may allow the user to import such sticker pack. The receiving entity SHOULD NOT offer to import a sticker pack that has a <restricted/> element.

When importing a sticker pack, the entity SHOULD make all files that are part of the sticker pack locally available. The entity SHOULD duplicate the pubsub item from its original source to the users personal eventing (PEP) node named "urn:xmpp:stickers:0", preserving the pack id. The entity MAY remove any of the sources provided, and MAY make an effort to make the files available at additional sources, e.g. by using &xep0363;.

After creating or importing a sticker pack, it can be shared using an xmpp:-uri as described in &xep0060;.

When handling this URI, the entity SHOULD display a preview of the sticker pack and allow importing it as described above.

xmpp:romeo@montague.lit?pubsub;action=retrieve;node=urn:xmpp:stickers:0;item=EpRv28DHHzFrE4zd%2BxaNpVb4

Flickering, flashing or blinking stickers can induce seizures or other incapacitating physical reactions. It is RECOMMENDED that clients that support stickers have an option to disable animations and/or stickers entirely.

The security considerations of &xep-sfs; apply.

This document requires no interaction with &IANA;.

The ®ISTRAR; includes 'urn:xmpp:stickers:0' in its registry of protocol namespaces (see &NAMESPACES;).

  • urn:xmpp:stickers:0