3
0
mirror of https://github.com/jlu5/PyLink.git synced 2025-01-11 12:42:34 +01:00

commands: fix 'showchan' displaying status prefixes in reverse

This commit is contained in:
James Lu 2018-01-22 08:10:55 -08:00
parent d608661a33
commit 5fd216c720

View File

@ -120,7 +120,8 @@ def showchan(irc, source, args):
# Iterate over the user list, sorted by nick. # Iterate over the user list, sorted by nick.
for user, nick in sorted(zip(c.users, nicks), for user, nick in sorted(zip(c.users, nicks),
key=lambda userpair: userpair[1].lower()): key=lambda userpair: userpair[1].lower()):
for pmode in c.get_prefix_modes(user): # Note: reversed() is used here because we're adding prefixes onto the nick in reverse
for pmode in reversed(c.get_prefix_modes(user)):
# Show prefix modes in order from highest to lowest. # Show prefix modes in order from highest to lowest.
nick = irc.prefixmodes.get(irc.cmodes.get(pmode, ''), '') + nick nick = irc.prefixmodes.get(irc.cmodes.get(pmode, ''), '') + nick
nicklist.append(nick) nicklist.append(nick)