mirror of
https://github.com/jlu5/PyLink.git
synced 2024-11-24 03:29:28 +01:00
handlers: only show the highest prefix mode for channels in WHOIS output
Closes #270.
This commit is contained in:
parent
2a08ae98b0
commit
1cf560c465
@ -41,9 +41,15 @@ def handle_whois(irc, source, command, args):
|
||||
and not (sourceisOper or source in c.users):
|
||||
continue
|
||||
|
||||
# Show prefix modes like a regular IRCd does.
|
||||
for prefixmode in c.getPrefixModes(target):
|
||||
modechar = irc.cmodes[prefixmode]
|
||||
# Show the highest prefix mode like a regular IRCd does, if there are any.
|
||||
prefixes = c.getPrefixModes(target)
|
||||
if prefixes:
|
||||
highest = prefixes[-1]
|
||||
|
||||
# Fetch the prefix mode letter from the named mode.
|
||||
modechar = irc.cmodes[highest]
|
||||
|
||||
# Fetch and prepend the prefix character (@, +, etc.), given the mode letter.
|
||||
chan = irc.prefixmodes[modechar] + chan
|
||||
|
||||
public_chans.append(chan)
|
||||
|
Loading…
Reference in New Issue
Block a user