diff --git a/plugins/Admin/plugin.py b/plugins/Admin/plugin.py index 4f5abb728..71775a7ad 100644 --- a/plugins/Admin/plugin.py +++ b/plugins/Admin/plugin.py @@ -49,8 +49,8 @@ class Admin(callbacks.Plugin): def do437(self, irc, msg): """Nick/channel temporarily unavailable.""" target = msg.args[0] + t = time.time() + 30 if irc.isChannel(target): # We don't care about nicks. - t = time.time() + 30 # Let's schedule a rejoin. networkGroup = conf.supybot.networks.get(irc.network) def rejoin(): @@ -60,6 +60,16 @@ class Admin(callbacks.Plugin): schedule.addEvent(rejoin, t) self.log.info('Scheduling a rejoin to %s at %s; ' 'Channel temporarily unavailable.', target, t) + else: + irc = self.pendingNickChanges.get(irc, None) + if irc is not None: + def nick(): + irc.queueMsg(ircmsgs.nick(target)) + schedule.addEvent(nick, t) + self.log.info('Scheduling a nick change to %s at %s; ' + 'Nick temporarily unavailable.', target, t) + else: + self.log.debug('Got 437 without Admin.nick being called.') def do471(self, irc, msg): try: diff --git a/src/irclib.py b/src/irclib.py index 27c373c1a..41a141136 100644 --- a/src/irclib.py +++ b/src/irclib.py @@ -939,8 +939,11 @@ class Irc(IrcCommandDispatcher): if not self.afterConnect: newNick = self._getNextNick() assert newNick != self.nick - log.info('Got 433: %s %s. Trying %s.',self.nick, problem, newNick) + log.info('Got %s: %s %s. Trying %s.', + msg.command, self.nick, problem, newNick) self.sendMsg(ircmsgs.nick(newNick)) + def do437(self, msg): + self.do43x(msg, 'is temporarily unavailable') def do433(self, msg): self.do43x(msg, 'is in use') def do432(self, msg):