# HG changeset patch # User Charly COSTE # Date 1252066908 -7200 # Node ID a8749705fe946324ecdcd7ebcdede312db5f9ee4 # Parent 686724c5183ccf838cf44e78220e04b040e6c4ea Fixed IRC quit event handling Signed-off-by: Charly COSTE diff --git a/bot.py b/bot.py --- a/bot.py +++ b/bot.py @@ -316,9 +316,6 @@ class bot(Thread): self.error('=> Debug: ignoring IRC '+event.eventtype()+' sent by self', debug=True) return - if event.eventtype() == 'quit' and connection in self.irc.connections: - return - # TODO: lock self.bridges for thread safety for bridge in self.bridges: if connection.server != bridge.irc_server: @@ -369,6 +366,8 @@ class bot(Thread): # Leaving events if event.eventtype() == 'quit' or event.eventtype() == 'part' and event.target().lower() == bridge.irc_room: + if event.eventtype() == 'quit' and ( bridge.mode != 'normal' or isinstance(from_.irc_connection, irclib.ServerConnection) ): + continue if len(event.arguments()) > 0: leave_message = event.arguments()[0] elif event.eventtype() == 'quit': diff --git a/participant.py b/participant.py --- a/participant.py +++ b/participant.py @@ -204,6 +204,7 @@ class participant: self.muc.leave(auto_decode(message)) self.bridge.bot.close_xmpp_connection(self.nickname) if isinstance(self.irc_connection, ServerConnection): + self.irc_connection.part(self.bridge.irc_room, message=message) self.irc_connection.used_by -= 1 if self.irc_connection.used_by < 1: self.irc_connection.close(message)