if not update.old_value:
nicks = []
for id_ in sorted(update.value):
- nicks += [f'NICK:{id_}', ':, ']
+ nicks += [
+ ':' + ''.join(prefix for prefix in self.prefixes.keys()
+ if id_ in self.prefixes[prefix]),
+ f'NICK:{id_}',
+ ':, ']
nicks.pop()
update.results += [(_LogScope.CHAT, [':residents: '] + nicks)]
else:
log 1 $ channels:#ch_test0:prefixes:+ set to: [3], [4]
insert user-set-to :1 + USER_ID=5 USERNICK :zab
insert join-channel-1 : + CHANNEL=#ch_test0 RESIDENT_IDS :[2], [3], [4], [5], [me]
-log 3 $ residents: baz, oof, rab, zab, foo
+log 3 $ residents: @baz, +oof, +rab, zab, foo
# check server giving and taking membership prefixes
insert servermsglogged : + MSG ::foo.bar.baz MODE #ch_test0 +o zab
log 1 $ channels:#ch_test6:prefixes:+ set to: [2]
insert user-set-to :1 +1 USER_ID=3 USERNICK :=quux
insert join-channel-1 : +0 CHANNEL=#ch_test6 RESIDENT_IDS :[1], [2], [3], [me]
-log 7 $ residents: bar, baz, =quux, foo
+log 7 $ residents: @bar, +baz, =quux, foo
insert un-default : +0 KEY=PREFIX VALUE :(vE)+=
insert join-channel-0 : +0 CHANNEL=#ch_test7 RESIDENT_NAMES :foo @bar +baz =quux
insert user-set-to :1 +1 USER_ID=4 USERNICK :@bar
insert user-set-to :1 +1 USER_ID=5 USERNICK :quux
log 1 $ channels:#ch_test7:prefixes:= set to: [5]
insert join-channel-1 : +0 CHANNEL=#ch_test7 RESIDENT_IDS :[2], [4], [5], [me]
-log 8 $ residents: baz, @bar, quux, foo
+log 8 $ residents: +baz, @bar, =quux, foo
# test effect of USERLEN
insert join-empty : + CHAN_WIN_ID=9 CHANNEL :#ch_test8
insert user-set-to :1 +1 USER_ID=1 USERNICK :baz
log 1 $ channels:#test:prefixes:@ set to: [1]
insert join-channel-1 : +0 CHANNEL=#test RESIDENT_IDS :[1], [me]
-log 4 $ residents: baz, foo
+log 4 $ residents: @baz, foo
# process non-self channel JOIN
insert servermsglogged : +0 MSG ::bar!~bar@bar.bar JOIN :#test