Hello everyone,

I have a question regarding XEP-0449 Stickers: My implementation of this
XEP caches each sticker pack that the user requested or has installed
locally. When I receive a message that should be treated as a sticker,
based on what should I find the correct sticker in my cache?

I feel like the XEP is a bit vague in this regard. My current
implementation relies on matching the message's body with a sticker's
description. But this breaks down once multiple stickers have the same
description or a client sends a different body.

If this problem is indeed an issue with the XEP and not just my
understanding, then I would also propose a solution from an unpublished
attempt at a XEP for stickers: Give each sticker a sticker-pack-unique
identifier and add it to the sticker tag like this:

<message ...>
         <body>Whatever</body>
         <sticker pack="pack-id" id="that-one-sticker"/>
         <file-sharing>
                ...
         </file-sharing>
</message>

This would also allow more efficient implementations, as one could just
use a table to find stickers inside their packs instead of, what I am
currently doing, iterating over the entire pack.

What do you think about this?

- Alexander
_______________________________________________
Standards mailing list
Info: https://mail.jabber.org/mailman/listinfo/standards
Unsubscribe: [email protected]
_______________________________________________

Reply via email to