Mercurial > xib
comparison bot.py @ 30:c0fb916cb0a0
Fixed IRC leaving events handling.
Signed-off-by: Charly COSTE <changaco@changaco.net>
author | Charly COSTE <changaco@changaco.net> |
---|---|
date | Fri, 21 Aug 2009 17:03:20 +0200 |
parents | a694ffe6a973 |
children | 8aa261545662 |
comparison
equal
deleted
inserted
replaced
29:a694ffe6a973 | 30:c0fb916cb0a0 |
---|---|
315 | 315 |
316 self.error(event_str, debug=True) | 316 self.error(event_str, debug=True) |
317 | 317 |
318 | 318 |
319 # Leaving events | 319 # Leaving events |
320 if event.eventtype() == 'quit' or event.eventtype() == 'part' and event.target() == bridge.irc_room: | 320 if connection.server == bridge.irc_server and (event.eventtype() == 'quit' or event.eventtype() == 'part' and event.target() == bridge.irc_room): |
321 if from_.protocol == 'irc': | 321 if len(event.arguments()) > 0: |
322 bridge.removeParticipant('irc', from_.nickname, event.arguments()[0]) | 322 leave_message = event.arguments()[0] |
323 elif event.eventtype() == 'quit': | |
324 leave_message = 'Left server.' | |
325 elif event.eventtype() == 'part': | |
326 leave_message = 'Left channel.' | |
327 else: | |
328 leave_message = '' | |
329 bridge.removeParticipant('irc', from_.nickname, leave_message) | |
323 continue | 330 continue |
324 | 331 |
325 | 332 |
326 # Nickname change | 333 # Nickname change |
327 if event.eventtype() == 'nick' and from_.protocol == 'irc': | 334 if event.eventtype() == 'nick' and from_.protocol == 'irc': |