-
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?
-
Zash
Are you joining the chat first?
-
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.
-
Zash
"initial presence" is a term unrelated to MUC tho
-
Zash
So, please tell us what you've done so far and where it stops working as you expect
-
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?
-
Michael
Oh, by the way: Thank you very much for your time! 😉
-
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.
-
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.
-
Michael
Hmm, it's OK, that doesn't matter. Thank you anyway.
-
Michael
I'm using the xmpppy library - just in case one of the other mates would take over... 😉
-
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
-
lovetox
Michael, maybe use a newer lib which is better documented?
-
lovetox
https://github.com/horazont/aioxmpp comes to mind, but only if you feel confortable with using async python
-
singpolyma
I hear slix has an async mode now too, so that might also be an option
-
Link Mauve
singpolyma, slixmpp was the asyncio fork of SleekXMPP.
-
Link Mauve
Nowadays SleekXMPP is dead, and you should upgrade to slixmpp instead.
-
singpolyma
Ah, makes sense
-
Michael
I think I will give SleekXMPP a try... I found a well documented example. Many thanks for your time.
-
Michael
🙂
-
Link Mauve
Michael, as I said, this library is now unmaintained, you should use slixmpp instead.
-
Michael
OK, well then Slixmpp.