3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-12-25 04:02:45 +01:00

nefarious: don't confuse the TS argument with the user list, if a BURST is sent with only bans

This commit is contained in:
James Lu 2016-04-18 21:29:00 -07:00
parent fd909395ff
commit 9f454402d2

View File

@ -927,8 +927,6 @@ class P10Protocol(Protocol):
# Remove this argument from the args list.
args = args[:-1]
userlist = args[-1].split(',')
# 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]
@ -947,6 +945,9 @@ class P10Protocol(Protocol):
log.debug('(%s) handle_sjoin: got userlist %r for %r', self.irc.name, userlist, channel)
prefixes = ''
userlist = args[-1].split(',')
if args[-1] != args[1]: # Make sure the userlist is the right argument (not the TS).
for userpair in userlist:
# This is given in the form UID1,UID2:prefixes. However, when one userpair is given
# with a certain prefix, it implicitly applies to all other following UIDs, until
@ -972,6 +973,7 @@ class P10Protocol(Protocol):
utils.applyModes(self.irc, channel, [('+%s' % mode, user) for mode in prefixes])
self.irc.channels[channel].users.add(user)
return {'channel': channel, 'users': namelist, 'modes': parsedmodes, 'ts': their_ts}
def handle_join(self, source, command, args):