From 0d497a8f72a6153816c8c23cd2896c9b780facc6 Mon Sep 17 00:00:00 2001 From: James Lu Date: Mon, 24 Aug 2015 18:37:46 -0700 Subject: [PATCH] coreplugin: show channel prefixes in WHOIS reply --- coreplugin.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/coreplugin.py b/coreplugin.py index 53ef998..6a2b163 100644 --- a/coreplugin.py +++ b/coreplugin.py @@ -61,7 +61,11 @@ def handle_whois(irc, source, command, args): (irc.cmodes.get('private'), None) in c.modes) \ and not (sourceisOper or source in c.users): continue - # TODO: show prefix modes like a regular IRCd does. + # 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]+'s']: + chan = prefixchar + chan public_chans.append(chan) if public_chans: f(irc, server, 319, source, '%s :%s' % (nick, ' '.join(public_chans)))