diff bridge.py @ 131:46af7f2744a9

added irclib.ServerConnection.left_channels Signed-off-by: Charly COSTE <changaco@changaco.net>
author Charly COSTE <changaco@changaco.net>
date Fri, 15 Jan 2010 16:30:50 +0100
parents efdc038e757a
children 6a6885dbed25
line wrap: on
line diff
--- a/bridge.py
+++ b/bridge.py
@@ -283,11 +283,13 @@ class Bridge:
 				if left_protocol == 'xmpp':
 					was_on_both = False
 				elif left_protocol == 'irc':
-					try:
+					if isinstance(p.irc_connection, ServerConnection):
 						p.irc_connection.join(self.irc_room)
-					except:
-						p._close_irc_connection(leave_message)
-						p.createDuplicateOnIRC()
+					else:
+						c = self.bot.irc.get_connection(self.irc_server, self.irc_port, p.duplicate_nickname)
+						if not (c and self.irc_room in c.left_channels):
+							p._close_irc_connection(leave_message)
+							p.createDuplicateOnIRC()
 					return
 		
 		elif p.protocol == 'irc':