mirror of
https://github.com/jlu5/PyLink.git
synced 2025-02-25 18:00:39 +01:00
handlers: handle WHOIS requests to unknown nicks instead of warning
"/whois pylink.server badnick" is allowed everywhere except InspIRCd.
This commit is contained in:
parent
8e29e16144
commit
6a1349847f
@ -9,12 +9,15 @@ def handle_whois(irc, source, command, args):
|
|||||||
"""Handle WHOIS queries, for IRCds that send them across servers (charybdis, UnrealIRCd; NOT InspIRCd)."""
|
"""Handle WHOIS queries, for IRCds that send them across servers (charybdis, UnrealIRCd; NOT InspIRCd)."""
|
||||||
target = args['target']
|
target = args['target']
|
||||||
user = irc.users.get(target)
|
user = irc.users.get(target)
|
||||||
if user is None:
|
|
||||||
log.warning('(%s) Got a WHOIS request for %r from %r, but the target '
|
|
||||||
'doesn\'t exist in irc.users!', irc.name, target, source)
|
|
||||||
return
|
|
||||||
f = irc.proto.numeric
|
f = irc.proto.numeric
|
||||||
server = irc.sid
|
server = irc.sid
|
||||||
|
|
||||||
|
if user is None: # User doesn't exist
|
||||||
|
# <- :42X 401 7PYAAAAAB GL- :No such nick/channel
|
||||||
|
nick = target
|
||||||
|
f(server, 401, source, "%s :No such nick/channel" % nick)
|
||||||
|
else:
|
||||||
nick = user.nick
|
nick = user.nick
|
||||||
sourceisOper = ('o', None) in irc.users[source].modes
|
sourceisOper = ('o', None) in irc.users[source].modes
|
||||||
sourceisBot = (irc.umodes.get('bot'), None) in irc.users[source].modes
|
sourceisBot = (irc.umodes.get('bot'), None) in irc.users[source].modes
|
||||||
|
Loading…
x
Reference in New Issue
Block a user