Mercurial > xib
comparison bot.py @ 78:a8749705fe94
Fixed IRC quit event handling
Signed-off-by: Charly COSTE <changaco@changaco.net>
author | Charly COSTE <changaco@changaco.net> |
---|---|
date | Fri, 04 Sep 2009 14:21:48 +0200 |
parents | 686724c5183c |
children | 73a30fc1922b |
comparison
equal
deleted
inserted
replaced
77:686724c5183c | 78:a8749705fe94 |
---|---|
314 return | 314 return |
315 if nickname == self.nickname: | 315 if nickname == self.nickname: |
316 self.error('=> Debug: ignoring IRC '+event.eventtype()+' sent by self', debug=True) | 316 self.error('=> Debug: ignoring IRC '+event.eventtype()+' sent by self', debug=True) |
317 return | 317 return |
318 | 318 |
319 if event.eventtype() == 'quit' and connection in self.irc.connections: | |
320 return | |
321 | |
322 # TODO: lock self.bridges for thread safety | 319 # TODO: lock self.bridges for thread safety |
323 for bridge in self.bridges: | 320 for bridge in self.bridges: |
324 if connection.server != bridge.irc_server: | 321 if connection.server != bridge.irc_server: |
325 continue | 322 continue |
326 | 323 |
367 continue | 364 continue |
368 | 365 |
369 | 366 |
370 # Leaving events | 367 # Leaving events |
371 if event.eventtype() == 'quit' or event.eventtype() == 'part' and event.target().lower() == bridge.irc_room: | 368 if event.eventtype() == 'quit' or event.eventtype() == 'part' and event.target().lower() == bridge.irc_room: |
369 if event.eventtype() == 'quit' and ( bridge.mode != 'normal' or isinstance(from_.irc_connection, irclib.ServerConnection) ): | |
370 continue | |
372 if len(event.arguments()) > 0: | 371 if len(event.arguments()) > 0: |
373 leave_message = event.arguments()[0] | 372 leave_message = event.arguments()[0] |
374 elif event.eventtype() == 'quit': | 373 elif event.eventtype() == 'quit': |
375 leave_message = 'Left server.' | 374 leave_message = 'Left server.' |
376 elif event.eventtype() == 'part': | 375 elif event.eventtype() == 'part': |