From f90b0c857745090ff330fe70421966e11d65a9d6 Mon Sep 17 00:00:00 2001 From: James Lu Date: Mon, 29 Apr 2019 12:04:11 -0700 Subject: [PATCH] clientbot: avoid adding empty nicks to the state It looks like names replies may end with an extra space, which should not be considered as part of the nick list.. --- protocols/clientbot.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/protocols/clientbot.py b/protocols/clientbot.py index 05c62d5..728cdc3 100644 --- a/protocols/clientbot.py +++ b/protocols/clientbot.py @@ -742,7 +742,7 @@ class ClientbotWrapperProtocol(ClientbotBaseProtocol, IRCCommonProtocol): # N.B. only split on spaces because of color in hosts nonsense... # str.split() by default treats \x1f as whitespace - for name in args[-1].split(' '): + for name in args[-1].strip().split(' '): nick = name.lstrip(prefixes) # Handle userhost-in-names where available. @@ -754,6 +754,9 @@ class ClientbotWrapperProtocol(ClientbotBaseProtocol, IRCCommonProtocol): log.exception('(%s) Failed to split hostmask %r from /names reply on %s; args=%s', self.name, nick, channel, args) # If error, leave nick unsplit + if not nick: + continue + # Get the PUID for the given nick. If one doesn't exist, spawn # a new virtual user. idsource = self._get_UID(nick, ident=ident, host=host)