jdev - 2024-08-01


  1. Schimon

    Good day. This is a matter which is not directly related to development. I want to add references to XMPP PubSub projects in a "help" page. Where do you think it would best fit at?

  2. Schimon

    https://xmpp.pimux.de/file_share/19504dea-47b3-4573-bdaf-846026ab0a9d/libervia_and_movim.png

  3. Schimon

    Should Libervia and Movim be under "XMPP" rather than "Friends"?

  4. Schimon

    Should Libervia and Movim be under "About" or "XMPP" rather than "Friends"?

  5. nicoco__

    If I cache BoB data, should I cache by the (jid, cid) couple or should I consider the cid unique enough?

  6. nicoco__

    ~If~ When I cache BoB data, should I cache by the (jid, cid) couple or should I consider the cid unique enough?

  7. singpolyma

    Up to you. I store all media by hash alone even if it didn't come by bob

  8. nicoco__

    Which hash algo do you use and how do you handle the case where the CID does not use the same hash algo you use?

  9. singpolyma

    I use multiple and I refuse Cids with an unknown algorithm since I can't verify them

  10. nicoco__

    I see, thanks. What's a reasonable list of hash algorithms to use?

  11. nicoco__

    ie, what do _you_use ^^

  12. singpolyma

    I use sha1 (for compatibility, I'd like to remove it eventually) sha256, sha512. I'm considering removing sha512 and adding sha3

  13. nicoco__

    maybe I should just use the list of XEP-0300?

  14. nicoco__

    that's probably too long, I'll do like because I have no personality

  15. seil

    Is there no standard for user activity state (active, away, xa, dnd, unavailable etc)? I'm currently getting all presence messages like normal but different clients seem to send presence differently (oversimplified but Conversations.im sends `<idle/>` and Gajim sends `<show><idle></show`>)

  16. nicoco__

    seil: as of now, every client ("resource") sets his presence independantly. a new XEP about this has been discussed a few times, but no one did it yet.

  17. seil

    > seil: as of now, every client ("resource") sets his presence independantly. a new XEP about this has been discussed a few times, but no one did it yet. what's the xep?

  18. seil

    and is there any "good enough" solution at the moment?

  19. nicoco__

    the new one that does not exist yet? lol

  20. nicoco__

    > and is there any "good enough" solution at the moment? yes, lemme find you how gajim merges conflicting presences

    👍 1
  21. seil

    > the new one that does not exist yet? lol I've seen a couple proposed XEPs in the directory

  22. nicoco__

    oh well it's not as readable as I thought it would be

  23. nicoco__

    https://dev.gajim.org/gajim/gajim/-/blob/master/gajim/common/modules/contacts.py#L432

  24. nicoco__

    you need https://dev.gajim.org/gajim/python-nbxmpp/-/blob/master/nbxmpp/const.py?ref_type=heads#L153

  25. nicoco__

    to understand

  26. seil

    That's fine, I'll get it eventually 🤣

  27. wgreenhouse

    my understanding is you should show the presence of the highest-priority client, or the "most online" if there are multiple presences at same priority

  28. nicoco__

    can someone try if the sha1 in https://xmpp.org/extensions/xep-0231.html#example-3 matched the base64-encoded data?

  29. wgreenhouse

    but maybe that's a gross oversimplification

  30. nicoco__

    I find 4b97ce7f0f06a0e05999f3c719cd5b4f3da992a7 vs 8f35fef110ffc5df08d579a50083ff9308fb6242 but I wonder if I did things right…

  31. nicoco__

    my snippet in python is: ```python import base64 import hashlib print(hashlib.sha1(base64.b64decode("iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAABGdBTUEAALGPC/xhBQAAAAlwSFlzAAALEwAACxMBAJqcGAAAAAd0SU1FB9YGARc5KB0XV+IAAAAddEVYdENvbW1lbnQAQ3JlYXRlZCB3aXRoIFRoZSBHSU1Q72QlbgAAAF1JREFUGNO9zL0NglAAxPEfdLTs4BZM4DIO4C7OwQg2JoQ9LE1exdlYvBBeZ7jqch9//q1uH4TLzw4d6+ErXMMcXuHWxId3KOETnnXXV6MJpcq2MLaI97CER3N0vr4MkhoXe0rZigAAAABJRU5ErkJggg==")).hexdigest()) ```

  32. nicoco__

    (examples are not normative, I know)

  33. moparisthebest

    nicoco__: I get the same result as you using base64 -d | sha1sum, want to make an MR ? :)

  34. singpolyma

    > my understanding is you should show the presence of the highest-priority client, or the "most online" if there are multiple presences at same priority Correct. And if you want something similar but account wide we have xeps covering this, the most obvious one being User Activity

  35. seil

    Thank you

  36. nicoco__

    > nicoco__: I get the same result as you using base64 -d | sha1sum, want to make an MR ? :) thanks OK, so it turns out I'm able to use the python standard lib. No MR, this is actually a case to handle I guess, mismatching CID and content :P