comparison participant.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 b29fd5696a78
children 99f3dee1fad7
comparison
equal deleted inserted replaced
122:9e90e15913a7 123:75a03f10a863
168 if isinstance(self.irc_connection, ServerConnection): 168 if isinstance(self.irc_connection, ServerConnection):
169 self.irc_connection.close('') 169 self.irc_connection.close('')
170 self.irc_connection = error 170 self.irc_connection = error
171 171
172 172
173 def set_both_sides(self):
174 self.bridge.bot.error('===> Debug: "'+self.nickname+'" is on both sides of bridge "'+str(self.bridge)+'"', debug=True)
175 self.bridge.say('[Warning] The nickname "'+self.nickname+'" is used on both sides of the bridge, please avoid that if possible')
176 if isinstance(self.irc_connection, ServerConnection):
177 self.irc_connection.close('')
178 if self.irc_connection != 'both':
179 self.irc_connection = 'both'
180 if isinstance(self.muc, xmpp.muc):
181 self.muc.leave('')
182 self.bridge.bot.close_xmpp_connection(self.nickname)
183 if self.xmpp_c != 'both':
184 self.xmpp_c = 'both'
185
186
173 def changeNickname(self, newnick, on_protocol): 187 def changeNickname(self, newnick, on_protocol):
174 """Change participant's nickname.""" 188 """Change participant's nickname."""
175 189
176 oldnick = self.nickname 190 oldnick = self.nickname
177 191