comparison participant.py @ 189:e04410e7e527

split the leaving process in two, first call to Bridge.removeParticipant() calls Participant.leave(), second call (when the bot receives the part or quit event) removes it from Bridge.participants Signed-off-by: Charly COSTE <changaco@changaco.net>
author Charly COSTE <changaco@changaco.net>
date Sat, 20 Feb 2010 23:08:39 +0100
parents 6173873c6b0d
children 12fa9bb73b1d
comparison
equal deleted inserted replaced
188:bd185885d4ca 189:e04410e7e527
35 self.nickname = nickname 35 self.nickname = nickname
36 self.duplicate_nickname = self.nickname 36 self.duplicate_nickname = self.nickname
37 self.irc_connection = None 37 self.irc_connection = None
38 self.xmpp_c = None 38 self.xmpp_c = None
39 self.muc = None 39 self.muc = None
40 self.left = False
40 if protocol == 'xmpp' and self.bridge.mode in ['normal', 'bypass']: 41 if protocol == 'xmpp' and self.bridge.mode in ['normal', 'bypass']:
41 self.createDuplicateOnIRC() 42 self.createDuplicateOnIRC()
42 elif protocol == 'irc' and self.bridge.mode != 'minimal': 43 elif protocol == 'irc' and self.bridge.mode != 'minimal':
43 self.createDuplicateOnXMPP() 44 self.createDuplicateOnXMPP()
44 45
329 330
330 331
331 def leave(self, message): 332 def leave(self, message):
332 if message == None: 333 if message == None:
333 message = '' 334 message = ''
335 self.left = True
334 self._close_xmpp_connection(message) 336 self._close_xmpp_connection(message)
335 self._close_irc_connection(message) 337 self._close_irc_connection(message)
336 338
337 339
338 def _close_xmpp_connection(self, message): 340 def _close_xmpp_connection(self, message):