3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-12-24 19:52:53 +01:00

nefarious: fix BURST prefix handling

When one userpair is given with some mode prefixes, it implicitly applies to all other following UIDs,
until another userpair is given with a prefix. For example: UID1,UID3:o,UID4,UID5 would assume that
UID1 has no prefixes, but UID3-5 all have op when joining.

This was not properly accounted for previously.
This commit is contained in:
James Lu 2016-04-16 17:06:48 -07:00
parent fccfb62609
commit 25ca2f8399

View File

@ -630,13 +630,17 @@ class P10Protocol(Protocol):
namelist = []
log.debug('(%s) handle_sjoin: got userlist %r for %r', self.irc.name, userlist, channel)
prefixes = ''
for userpair in userlist:
# This is given in the form UID1,UID2:prefixes
# 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
# another userpair is given with a prefix. For example: UID1,UID3:o,UID4,UID5 would
# assume that UID1 has no prefixes, but UID3-5 all have op when joining.
try:
user, prefixes = userpair.split(':')
except ValueError:
user = userpair
prefixes = ''
log.debug('(%s) handle_burst: got mode prefixes %r for user %r', self.irc.name, prefixes, user)
# Don't crash when we get an invalid UID.