3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-11-01 09:19:23 +01:00

coreplugin: use IrcChannel.getPrefixModes in whois replies

This commit is contained in:
James Lu 2016-03-19 18:08:19 -07:00
parent f5f0df52ce
commit c176c90bb6

View File

@ -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)))