Mercurial > xib
comparison participant.py @ 145:ddc87b605019
minor fix in Participant.changeNickname()
Signed-off-by: Charly COSTE <changaco@changaco.net>
author | Charly COSTE <changaco@changaco.net> |
---|---|
date | Sun, 17 Jan 2010 17:42:36 +0100 |
parents | 9f39cead20cb |
children | e0eea72ea493 |
comparison
equal
deleted
inserted
replaced
144:fcab2bdf1d65 | 145:ddc87b605019 |
---|---|
180 | 180 |
181 | 181 |
182 def changeNickname(self, newnick, on_protocol): | 182 def changeNickname(self, newnick, on_protocol): |
183 """Change participant's nickname.""" | 183 """Change participant's nickname.""" |
184 | 184 |
185 p = None | |
185 oldnick = self.nickname | 186 oldnick = self.nickname |
186 | 187 |
187 if self.protocol == 'xmpp': | 188 if self.protocol == 'xmpp': |
188 if on_protocol == 'xmpp': | 189 if on_protocol == 'xmpp': |
189 self._close_irc_connection('unwanted nick change') | 190 self._close_irc_connection('unwanted nick change') |
240 self.createDuplicateOnXMPP() | 241 self.createDuplicateOnXMPP() |
241 return | 242 return |
242 | 243 |
243 self.nickname = newnick | 244 self.nickname = newnick |
244 self.duplicate_nickname = newnick | 245 self.duplicate_nickname = newnick |
246 | |
247 if not isinstance(p, Participant): | |
248 return | |
249 | |
245 if p.nickname == newnick: | 250 if p.nickname == newnick: |
246 if p.protocol == self.protocol: | 251 if p.protocol == self.protocol: |
247 # should never happen | 252 # should never happen |
248 raise Exception('WTF ?') | 253 raise Exception('WTF ?') |
249 else: | 254 else: |