comparison participant.py @ 62:61491895c607

Added bridge.hasParticipant() and fixed participant.changeNickname() Signed-off-by: Charly COSTE <changaco@changaco.net>
author Charly COSTE <changaco@changaco.net>
date Sat, 29 Aug 2009 14:52:11 +0200
parents 624c086b0a02
children 71508f22edb4
comparison
equal deleted inserted replaced
61:624c086b0a02 62:61491895c607
121 self.bridge.addParticipant('xmpp', newnick) 121 self.bridge.addParticipant('xmpp', newnick)
122 122
123 else: 123 else:
124 self.nickname = newnick 124 self.nickname = newnick
125 if self.muc != None: 125 if self.muc != None:
126 self.bridge.bot.xmpp_connections[newnick] = self.xmpp_c 126 for b in self.bridge.bot.bridges:
127 self.bridge.bot.xmpp_connections.pop(oldnick) 127 if b.hasParticipant(oldnick) and b.irc_server != self.bridge.irc_server:
128 self.muc.leave(message='Nickname change')
129 self.xmpp_c = None
130 self.bridge.bot.close_xmpp_connection(oldnick)
131 self.createDuplicateOnXMPP()
132 return
133
134 if not self.bridge.bot.xmpp_connections.has_key(newnick):
135 self.bridge.bot.xmpp_connections.pop(oldnick)
136 self.bridge.bot.xmpp_connections[newnick] = self.xmpp_c
137
128 self.muc.change_nick(newnick, status='From IRC', callback=self._xmpp_join_callback) 138 self.muc.change_nick(newnick, status='From IRC', callback=self._xmpp_join_callback)
129 else: 139 else:
130 self.createDuplicateOnXMPP() 140 self.createDuplicateOnXMPP()
131 141
132 142