Modern XMPP project discussion - 2025-02-22


  1. pjoter_

    had this thought in the morning about the concept of stickers in chats. Wouldn’t it be more efficient to negotiate between clients about which stickers we have instead of sending a full image/gif every time? Like just sending something like :nice_meme, and then the client would display the appropriate image? Alternatively, when updating a sticker pack version, it could just download the missing files

  2. pjoter_

    or even simpler - instead of sending the file every time, just check if it's already on the server and then use it normally with HTTP upload

  3. edhelas

    Thats how it's done already

  4. pjoter_

    edhelas: really? how is it implemented

  5. edhelas

    > edhelas: really? how is it implemented https://xmpp.org/extensions/xep-0231.html

  6. Squeaky Latex Folf

    Oh yeah was about to say that's how BoB works

  7. arcanicanis

    I still disagree with BoB as a solution for stickers, given it was probably envisioned back in the context of emoticons that were probably barely 32x32 pixels or so; meanwhile trying to stuff high-quality high-resolution stickers that get further overhead being encoded as base64 to fit within one single stanza, is something that feels error-prone and the lower threshold for max stanza size is probably going to stay as 65kb (ejabberd's default), which with base64 overhead means you have effectively an upper limit of 43.9kb to sticker size, or else face complications with the server forcibly dropping the connection (if I remember correctly) whenever you push out an oversized stanza. Even with butchering some Telegram stickers with heavy WebP compression, it's still often a valley until something fits under <43kb.

  8. arcanicanis

    I'm aware Movim does stickers via BoB as a distribution method with images that are typically ~200x200 (or higher, with much heavier compression), but it's hard to sell "hey, you have to butcher your resolution and/or quality, and gl;hf in ever expecting anything that comes out clean and high-res for a HiDPI screen" to artists

  9. arcanicanis

    and also know of it using BoB, per diagnosing why Movim went into a crash loop when adding custom stickers that were over the stanza limit, whenever an oversized sticker was sent

  10. arcanicanis

    and also know of it using BoB, per diagnosing why Movim went into a constant re-connection loop when adding custom stickers that were over the stanza limit, whenever an oversized sticker was sent

  11. edhelas

    Well, you have to optimize your stickers

  12. edhelas

    There's no magic there

  13. edhelas

    300x300 optimized PNG is between 15 and 30ko

  14. edhelas

    +30% base64, I think we can live with it

  15. arcanicanis

    My argument is that it's probably worth out-of-band, rather than (ab)using XMPP as a large binary blob transport

  16. edhelas

    I'm open to get a new XEP, but that one is "good enough" for me 🤷‍♂️

  17. edhelas

    And if you have a low size limitation like that for stickers, I don't think you'll receive a lot of avatars as well, that are often above that limit

  18. arcanicanis

    Yes, I understand it's a fair option, especially as something that doesn't take any special server support or anything to implement

  19. Zash

    https://xmpp.org/extensions/xep-0385.html and https://xmpp.org/extensions/xep-0447.html allow carrying a hash of the file, that should allow checking a local cache or sticker storage, no?

  20. arcanicanis

    I've seen those XEPs, not sure if there's a way it could be more concisely done as it's probably a little verbose. Meanwhile, one missing part is probably a 'media proxy' XEP, because the counterargument can also become 'what if the sticker is used to semi-de-anonymize the recipients?'

  21. arcanicanis

    When I finish my other projects I do want to dork around with XEP-0447/XEP-0449

  22. arcanicanis

    whereas a 'media proxy' could be an optional service advertised by a server, presented as an HTTPS endpoint that a client could use for cacheable proxied media access to XEP-0363 HTTP File Uploads or other HTTP-based out-of-band transports

  23. Squeaky Latex Folf

    Is there no way to do BoB or stickers over HTTP?

  24. Squeaky Latex Folf

    On Conversations and forks, using HTTP upload seems pretty close to being appropriate for stickers UI-wise

  25. arcanicanis

    BoB exists because you can't push raw binary over an XMPP stream, it creates a mechanism to wrap binary blobs in base64 to make it transportable in an XML payload, but the other thing is that BoB isn't really 'packetized' and the whole payload has to fit in one stanza. Meanwhile, "Stateless file sharing" and some others _would_ be an option to have stickers retrieved over HTTPS instead

  26. arcanicanis

    BoB exists because you can't push raw binary over an XMPP stream, it creates a mechanism to wrap binary blobs in base64 to make it transportable in an XML payload, but the other thing is that BoB isn't really 'packetized' and the whole payload has to fit in one stanza. Meanwhile, "Stateless file sharing" and some others _would_ be an option to have stickers retrieved over HTTPS instead, but I'm unaware of any active implementations

  27. Squeaky Latex Folf

    Well sharing an image has the same UI as a sticker on most clients that auto-download

  28. arcanicanis

    and the problem with plain HTTP File Uploads is that it's redundant, the files (on most servers) eventually expire and rotate out, no deduplication; ergo, some method to 'publish' a sticker pack and where to retrieve it, and a mode of referencing it, would be the best of every option

  29. Squeaky Latex Folf

    So then you can use HTTP upload, stateless file sharing, etc.

  30. arcanicanis

    whereas last I peeked at XEP-0449 as proposed; it's publishing a sticker pack via PubSub, and then referencing it via Stateless file sharing, with the addition of what pack it's from (...which feels a little redundant, and I don't see what value it's adding, other than making the broader collection discoverable)

  31. arcanicanis

    on the XEP list on xmpp.org, is 'implementation status' of a XEP for a specific client just a self-proclaimed, or does anyone actually go through and test that?

  32. Zash

    Self-claimed, by adding an entry in a file that goes into the website build.

  33. Zash

    Users test it. :)

  34. arcanicanis

    e.g. there allegedly being 6 client implementations for SIMS with Psi/Psi+ proclaimed as fully implemented, yet I can't find any hints or clues of it being implemented in Psi (in just a cursory review)

  35. Zash

    https://github.com/psi-im/iris/blob/eb691eba9584ab51fb016fcf3b643c317ff5bd7e/src/xmpp/xmpp-im/xmpp_reference.cpp#L26 looks like there's some code that mentions the XEP namespace at least

  36. arcanicanis

    That is always a neat thing with XMPP though: being able to Ctrl+F for the namespace, to quickly find the hints of where support for a XEP might start at

  37. arcanicanis

    as a nitpick with XEP-0447, wouldn't it have been fairer to have width, height, size, type, name as attributes instead, given there's generally not going to be multiple dimensions/sizes/etc for one file (rather than doubling the bytes needed to serialize that info)?

  38. arcanicanis

    the difference between: ``` <file xmlns='urn:xmpp:file:metadata:0' name='summit.jpg' size='3032449' width='4096' height='2160' mediatype='image/jpeg'> ``` and ``` <file xmlns='urn:xmpp:file:metadata:0'><name>summit.jpg</name><size>3032449</size><width>4096</width><height>2160</height><media-type>image/jpeg</media-type> ```

  39. arcanicanis

    (or probably a ping to larma, as I believe they're the author and present here?)

  40. larma

    arcanicanis, well, that surely is possible, but it also has downsides (e.g. makes extensibility harder or non-canoncical)

  41. larma

    I'm not sure there are good general XML design documents somewhere, but generally, I'd put things on attributes that are metadata to what is in the childs

  42. arcanicanis

    When is there a situation that there's multiple sizes/dimensions to a single file, or where that data would need further annotation? Because it feels like it's planning for a hypothetical future circumstance that might not exist.

  43. larma

    well, have you seen the examples with hashes and thumbnails?

  44. arcanicanis

    my understanding has generally been: if there's a situation where something may have multiple occurances, then it absolutely should be an element; if it's strictly singular and generally meta, it could pass as an attribute

  45. arcanicanis

    Yes, that's why I did not mention hashes, because that is an appropriate case

  46. larma

    but semantically, width/height/size/mediatype are a similar kind of metadata as hash, so it would be weird to position them differently

  47. arcanicanis

    It still circles back to the original argument: when is a single file going to have different file sizes or dimensions, or need alternate representations of those facts

  48. larma

    I understand that it would be smaller in bytes, but that alone should not be the main decision maker. And consistency with other metadata like hash for me is more important than saving a few bytes (especially when those are just due to the chosen serializatio)

  49. larma

    If you worry about size in bytes, use EXI, they said.

  50. arcanicanis

    Yes, but again, those are very different things; hash algorithms are typically temporary as over time things get changed out; meanwhile file size represented in byte count, and image size in pixels has been very timeless

  51. arcanicanis

    Technically the XEP somewhat contradicts with itself: you have size/width/height as elements for <file>, but then as attributes for <thumbnail>

  52. arcanicanis

    Technically the XEP somewhat contradicts with itself: you have size/width/height as child elements for <file>, but then as attributes for <thumbnail>

  53. arcanicanis

    Technically the XEP somewhat contradicts with itself: you have size/width/height as child elements for <file>, but then as attributes when represented in <thumbnail>