diff bridge.py @ 123:75a03f10a863

Code refactoring (new method participant.set_both_sides()) Signed-off-by: Charly COSTE <changaco@changaco.net>
author Charly COSTE <changaco@changaco.net>
date Wed, 13 Jan 2010 22:27:00 +0100
parents 9e90e15913a7
children 99f3dee1fad7
line wrap: on
line diff
--- a/bridge.py
+++ b/bridge.py
@@ -145,17 +145,7 @@ class bridge:
 					if irc_id:
 						p.irc_connection.irc_id = irc_id
 					return p
-				self.bot.error('===> Debug: "'+nickname+'" is on both sides of bridge "'+str(self)+'"', debug=True)
-				self.say('[Warning] The nickname "'+nickname+'" is used on both sides of the bridge, please avoid that if possible')
-				if isinstance(p.irc_connection, ServerConnection):
-					p.irc_connection.close('')
-				if p.irc_connection != 'both':
-					p.irc_connection = 'both'
-				if isinstance(p.muc, xmpp.muc):
-					p.muc.leave('')
-					self.bot.close_xmpp_connection(p.nickname)
-				if p.xmpp_c != 'both':
-					p.xmpp_c = 'both'
+				p.set_both_sides()
 			return p
 		except NoSuchParticipantException:
 			pass