jdev - 2023-10-14

  1. Michael

    Hi folks! I wonder if there is someone who can help me with the following: I've setup a little Python script which should send a message to an XMPP-MUC. I've also managed to send a message to a single reciever, already. But I'm struggling with that multi user chat. Is there someone who can advice me how to achieve that?

  2. Zash

    Are you joining the chat first?

  3. Michael

    No, that's my first issue. Everything looks nice, but when executing the code, it seems, that the initial presence is not set properly. Desipte the fact that I can see (with my mobile) that the status of that particular User switched to "ONLINE" for a second or two.

  4. Zash

    "initial presence" is a term unrelated to MUC tho

  5. Zash

    So, please tell us what you've done so far and where it stops working as you expect

  6. Michael

    I learned from other sources that it is neccessary to join the chat by sending the own "initial presence". To do so I tried to use the following code: InitPres = conn.sendInitPresence(requestRoster=1) print ('InitPres = ', InitPres) But the print section brings back always "none" Can you explain me how I can properly join a MUC via python?

  7. Michael

    Oh, by the way: Thank you very much for your time! 😉

  8. Zash

    In XMPP, "initial presence" is how you broadcast to your contacts that you are online. It is not how you join a group chat, which is a separate step most likely.

  9. Zash

    I'm not especially familiar with any python library and haven't said which one you use, so I don't think I can help you with that bit.

  10. Michael

    Hmm, it's OK, that doesn't matter. Thank you anyway.

  11. Michael

    I'm using the xmpppy library - just in case one of the other mates would take over... 😉

  12. singpolyma

    Michael: i know nothing about this library, but either it will have a facility to join rooms, or if it doesn't you need to send a specially formatted presence stanza to the room directly

  13. lovetox

    Michael, maybe use a newer lib which is better documented?

  14. lovetox

    https://github.com/horazont/aioxmpp comes to mind, but only if you feel confortable with using async python

  15. singpolyma

    I hear slix has an async mode now too, so that might also be an option

  16. Link Mauve

    singpolyma, slixmpp was the asyncio fork of SleekXMPP.

  17. Link Mauve

    Nowadays SleekXMPP is dead, and you should upgrade to slixmpp instead.

  18. singpolyma

    Ah, makes sense

  19. Michael

    I think I will give SleekXMPP a try... I found a well documented example. Many thanks for your time.

  20. Michael


  21. Link Mauve

    Michael, as I said, this library is now unmaintained, you should use slixmpp instead.

  22. Michael

    OK, well then Slixmpp.