# HG changeset patch # User Charly COSTE # Date 1252341239 -7200 # Node ID 8b071629558e350d2735e8a5b1c01df83e433266 # Parent 500d47b1d8cdbd967ab252b0f8a163fe7eba8d5d Handle IRC "kill" event Signed-off-by: Charly COSTE diff --git a/bot.py b/bot.py --- a/bot.py +++ b/bot.py @@ -475,7 +475,7 @@ class bot(Thread): self.error(event_str, debug=True) - if event.eventtype() == 'disconnect': + if event.eventtype() in ['disconnect', 'kill']: if len(event.arguments()) > 0 and event.arguments()[0] == 'Connection reset by peer': return @@ -484,9 +484,16 @@ class bot(Thread): if connection.server != bridge.irc_server: continue try: - bridge.getParticipant(connection.get_nickname()) + p = bridge.getParticipant(connection.get_nickname()) if bridge.mode == 'normal': bridge.switchFromNormalToLimitedMode() + else: + if p.irc_connection.really_connected == True: + p.irc_connection.part(bridge.irc_room, message=message) + p.irc_connection.used_by -= 1 + if p.irc_connection.used_by < 1: + p.irc_connection.close(message) + p.irc_connection = None except NoSuchParticipantException: pass return