From c176c90bb6d3ac87bbda8953e68ac3998fd138ab Mon Sep 17 00:00:00 2001 From: James Lu Date: Sat, 19 Mar 2016 18:08:19 -0700 Subject: [PATCH] coreplugin: use IrcChannel.getPrefixModes in whois replies --- coreplugin.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/coreplugin.py b/coreplugin.py index b8ba63e..ecc6c2e 100644 --- a/coreplugin.py +++ b/coreplugin.py @@ -59,12 +59,14 @@ def handle_whois(irc, source, command, args): (irc.cmodes.get('private'), None) in c.modes) \ and not (sourceisOper or source in c.users): continue + # Show prefix modes like a regular IRCd does. - for prefixmode, prefixchar in irc.prefixmodes.items(): - modename = [mname for mname, char in irc.cmodes.items() if char == prefixmode] - if modename and target in c.prefixmodes[modename[0]]: - chan = prefixchar + chan + for prefixmode in c.getPrefixModes(target): + modechar = irc.cmodes[prefixmode] + chan = irc.prefixmodes[modechar] + chan + public_chans.append(chan) + if public_chans: # Only send the line if the person is in any visible channels... f(server, 319, source, '%s :%s' % (nick, ' '.join(public_chans)))