From b9e568c9626d6f2e7ff1d3385cac2188493779bf Mon Sep 17 00:00:00 2001 From: James Lu Date: Fri, 15 Apr 2016 11:53:08 -0700 Subject: [PATCH] nefarious: don't send empty mode lists to parseModes Doing so raises assertionerror, which causes the link to fail! --- protocols/nefarious.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/protocols/nefarious.py b/protocols/nefarious.py index b735bb3..7b31e7e 100644 --- a/protocols/nefarious.py +++ b/protocols/nefarious.py @@ -477,12 +477,17 @@ class P10Protocol(Protocol): # Then, we can make the modestring just encompass all the text until the end of the string. # If no modes are given, this will simply be empty. modestring = args[2:-1] - parsedmodes = utils.parseModes(self.irc, channel, modestring) + if modestring: + parsedmodes = utils.parseModes(self.irc, channel, modestring) + else: + parsedmodes = [] # Add the ban list to the list of modes to process. parsedmodes.extend([('+b', host) for host in bans]) - utils.applyModes(self.irc, channel, parsedmodes) + if parsedmodes: + utils.applyModes(self.irc, channel, parsedmodes) + namelist = [] log.debug('(%s) handle_sjoin: got userlist %r for %r', self.irc.name, userlist, channel) for userpair in userlist: