From 68440bd83ae5b0c4c4a386cf90d5bbc517f0da5e Mon Sep 17 00:00:00 2001 From: Jeremy Fincher Date: Mon, 31 Mar 2003 08:12:50 +0000 Subject: [PATCH] Added proper NICK handling to IrcState --- src/irclib.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/irclib.py b/src/irclib.py index 1a16cc9ea..2e5bb10f7 100644 --- a/src/irclib.py +++ b/src/irclib.py @@ -73,7 +73,7 @@ class IrcCallback(object): method = getattr(self, commandName) try: method(irc, msg) - except Exception, e: + except Exception: debug.recoverableException() s = 'Exception raised by %s.%s' % \ (self.__class__.__name__, method.im_func.func_name) @@ -224,6 +224,15 @@ class IrcState(object): channel = msg.args[1].lower() chan = self.channels[channel] chan.topic = msg.args[2] + elif msg.command == 'NICK': + newNick = msg.args[0] + for channel in self.channels.itervalues(): + chan = self.channels[channel] + for s in (chan.users, chan.ops, chan.halfops, chan.voices): + if msg.nick in s: + s.remove(msg.nick) + s.add(newNick) + def getTopic(self, channel): return self.channels[channel.lower()].topic