From 5fd216c720d39dd0fb8f4a2fb15ac6f06b586125 Mon Sep 17 00:00:00 2001 From: James Lu Date: Mon, 22 Jan 2018 08:10:55 -0800 Subject: [PATCH] commands: fix 'showchan' displaying status prefixes in reverse --- plugins/commands.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/commands.py b/plugins/commands.py index fe9767b..311ed77 100644 --- a/plugins/commands.py +++ b/plugins/commands.py @@ -120,7 +120,8 @@ def showchan(irc, source, args): # Iterate over the user list, sorted by nick. for user, nick in sorted(zip(c.users, nicks), 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. nick = irc.prefixmodes.get(irc.cmodes.get(pmode, ''), '') + nick nicklist.append(nick)