From: Yann L. <as...@la...> - 2010-12-21 17:08:34
|
On 12/21/2010 06:00 PM, Bryan Oakley wrote: > I've got a simple client working that connects to a group chat. Now I > want to implement the ability to set the status to 'away' and/or log > out of the server. > > My first attempts don't seem to work -- if I call the disconnect() > method on the client that works, but then I'm not able to reconnect. > This makes me wonder if there's a more proper way to leave a chatroom. > > My initialization code looks like this: > > self.client = xmpp.Client(jid.getdomain(), debug=[]) > self.client.connect() > self.client.auth(jid.getNode(), password) > self.client.sendpresence("%s/%s" % (room, nick)) > > That all works great and I'm able to chat with people in the room. > What must I do to log out of that room (ie: set my status to 'away'), > yet be able to log back in later? To log out from a room (and not receive messages from the room) you just have to send an unavailable presence. You should read XEP-0045 which explains the groupchat (MUC) protocol in detail. |