mirror of
https://github.com/jlu5/PyLink.git
synced 2024-11-27 21:19:31 +01:00
coreplugin: use IrcChannel.getPrefixModes in whois replies
This commit is contained in:
parent
f5f0df52ce
commit
c176c90bb6
@ -59,12 +59,14 @@ def handle_whois(irc, source, command, args):
|
|||||||
(irc.cmodes.get('private'), None) in c.modes) \
|
(irc.cmodes.get('private'), None) in c.modes) \
|
||||||
and not (sourceisOper or source in c.users):
|
and not (sourceisOper or source in c.users):
|
||||||
continue
|
continue
|
||||||
|
|
||||||
# Show prefix modes like a regular IRCd does.
|
# Show prefix modes like a regular IRCd does.
|
||||||
for prefixmode, prefixchar in irc.prefixmodes.items():
|
for prefixmode in c.getPrefixModes(target):
|
||||||
modename = [mname for mname, char in irc.cmodes.items() if char == prefixmode]
|
modechar = irc.cmodes[prefixmode]
|
||||||
if modename and target in c.prefixmodes[modename[0]]:
|
chan = irc.prefixmodes[modechar] + chan
|
||||||
chan = prefixchar + chan
|
|
||||||
public_chans.append(chan)
|
public_chans.append(chan)
|
||||||
|
|
||||||
if public_chans: # Only send the line if the person is in any visible channels...
|
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)))
|
f(server, 319, source, '%s :%s' % (nick, ' '.join(public_chans)))
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user