From 814c7141451b63b0fc6a4a1fc6638a681f398d7d Mon Sep 17 00:00:00 2001 From: James Lu Date: Wed, 24 Aug 2016 22:54:53 -0700 Subject: [PATCH] clientbot: fix nick() using the wrong arguments I should learn to proofread... Also, outgoing NICK changes should not implicitly update the state; we should wait for the IRCd's acknowledgement instead. --- protocols/clientbot.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/protocols/clientbot.py b/protocols/clientbot.py index 6cb12c5..442b52c 100644 --- a/protocols/clientbot.py +++ b/protocols/clientbot.py @@ -180,10 +180,11 @@ class ClientbotWrapperProtocol(Protocol): def nick(self, source, newnick): """STUB: Sends NICK changes.""" if source == self.irc.pseudoclient.uid: - self.irc.send('NICK :%s' % (channel, self._expandPUID(target), reason)) + self.irc.send('NICK :%s' % newnick) + # No state update here: the IRCd will respond with a NICK acknowledgement if the change succeeds. else: self.irc.callHooks([source, 'CLIENTBOT_NICK', {'newnick': newnick}]) - self.irc.users[source].nick = newnick + self.irc.users[source].nick = newnick def notice(self, source, target, text): """Sends notices to the target."""