Changeset 125
- Timestamp:
- 10/31/07 17:13:32 (2 years ago)
- Files:
-
- 1 modified
-
randomchat/randomchat.py (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
randomchat/randomchat.py
r124 r125 90 90 message.setFrom(room_jid+'/'+config.NICK_GUEST) 91 91 con.send(message) 92 93 def destroy_room(self, room): 94 for jid in self.rooms[room]: 95 user = self.users[jid.getStripped()] 96 destroy = xmpp.Presence(to = jid, frm = room+'@'+self.jid+'/'+user['nick'], typ = 'unavailable', payload = [ 97 xmpp.Node('x', attrs={'xmlns': xmpp.NS_MUC+'#user'}, payload = [ 98 xmpp.Node('item', attrs={'affiliation': 'none', 'role': 'none'}), 99 xmpp.Node('destroy',payload = [ 100 xmpp.Node('reason', payload = ['Votre interlocuteur a quitté le salon'] ) 101 ]) 102 ]) 103 ]) 104 self.con.send(destroy) 105 del self.users[jid.getStripped()] 106 del self.rooms[room] 92 107 93 108 … … 129 144 self.rooms[room].append(frm) 130 145 else: # if the user is already in, and we are this far, that means that we got a presence type!= available, we assume that he has left the chat 131 #TODO 132 pass 146 self.destroy_room(room) 133 147 134 148 … … 152 166 self.invite(room,jid1) 153 167 self.invite(room,jid2) 168 #TODO add a timeout and destroy the room if neither of them has joined the room 154 169 155 170
