From dd7b3821e9f74d1416098975dda5321e2cec98d6 Mon Sep 17 00:00:00 2001 From: James Lu Date: Wed, 27 Apr 2016 16:43:09 -0700 Subject: [PATCH] nefarious: deduplicate outgoing BURST mode prefixes --- protocols/nefarious.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/protocols/nefarious.py b/protocols/nefarious.py index 251031f..257294e 100644 --- a/protocols/nefarious.py +++ b/protocols/nefarious.py @@ -484,6 +484,7 @@ class P10Protocol(Protocol): return num users = sorted(users, key=access_sort) + last_prefixes = '' for userpair in users: # We take as a list of (prefixmodes, uid) pairs. assert len(userpair) == 2, "Incorrect format of userpair: %r" % userpair @@ -494,11 +495,12 @@ class P10Protocol(Protocol): changedusers.append(user) log.debug('(%s) sjoin: adding %s:%s to namelist', self.irc.name, user, prefixes) - - if prefixes: + if prefixes and prefixes != last_prefixes: namelist.append('%s:%s' % (user, prefixes)) else: namelist.append(user) + + last_prefixes = prefixes if prefixes: for prefix in prefixes: changedmodes.append(('+%s' % prefix, user))