# HG changeset patch # User Charly COSTE # Date 1250458515 -7200 # Node ID 7cb790f5f2430a4cb06f6714e8a2791fe7cb0c9f # Parent 4b2faa511f01b610e71fb50c90acaaf036490df1 No comment. Signed-off-by: Charly COSTE diff --git a/bot.py b/bot.py --- a/bot.py +++ b/bot.py @@ -269,17 +269,18 @@ class bot(Thread): connection.bridge.addParticipant('irc', nickname) return try: + if not '!' in event.source(): + return from_ = connection.bridge.getParticipant(event.source().split('!')[0]) if event.eventtype() == 'quit' or event.eventtype() == 'part' and event.target() == connection.bridge.irc_room: if from_.protocol in ['irc', 'both']: connection.bridge.removeParticipant('irc', from_.nickname, event.arguments()[0]) return - if event.eventtype() == 'nick' and from_.protocol == 'irc': + if event.eventtype() == 'nick' and from_.protocol in ['irc', 'both']: from_.changeNickname(event.target(), 'xmpp') except NoSuchParticipantException: + self.error('===> Debug: NoSuchParticipantException "'+event.source().split('!')[0]+'"', debug=True) return - except AttributeError: - pass if event.eventtype() == 'pubmsg': if from_.protocol == 'irc' or from_.protocol == 'both': from_.sayOnXMPP(event.arguments()[0]) diff --git a/bridge.py b/bridge.py --- a/bridge.py +++ b/bridge.py @@ -70,7 +70,7 @@ class bridge: def addParticipant(self, protocol, nickname): """Add a participant to the bridge.""" if (protocol == 'irc' and nickname == self.irc_connection.get_nickname()) or (protocol == 'xmpp' and nickname == self.xmpp_room.nickname): - raise Exception('cannot add self') + raise Exception('Internal Error: cannot add self') try: p = self.getParticipant(nickname) if p.protocol != protocol: diff --git a/participant.py b/participant.py --- a/participant.py +++ b/participant.py @@ -140,11 +140,11 @@ class participant: self.createDuplicateOnXMPP() elif self.protocol == 'both': if on_protocol == 'irc': - self.protocol = 'xmpp' - self.createDuplicateOnIRC() + self.bridge.removeParticipant('xmpp', self.nickname, '') + self.bridge.addParticipant('xmpp', newnick) elif on_protocol == 'xmpp': - self.protocol = 'irc' - self.createDuplicateOnXMPP() + self.bridge.removeParticipant('irc', self.nickname, '') + self.bridge.addParticipant('irc', newnick) def sayOnIRC(self, message):