3
0
mirror of https://github.com/jlu5/PyLink.git synced 2025-02-26 02:10:39 +01:00

relay: don't error if the WHOIS target isn't a relay user... oops

This commit is contained in:
James Lu 2015-07-23 00:10:54 -07:00
parent 88c85c8475
commit 44e07b0c2f
2 changed files with 11 additions and 7 deletions

View File

@ -82,7 +82,9 @@ def handle_whois(irc, source, command, args):
# Iterate over plugin-created WHOIS handlers. They return a tuple # Iterate over plugin-created WHOIS handlers. They return a tuple
# or list with two arguments: the numeric, and the text to send. # or list with two arguments: the numeric, and the text to send.
for func in utils.whois_handlers: for func in utils.whois_handlers:
num, text = func(irc, target) res = func(irc, target)
if res:
num, text = res
f(irc, server, num, source, text) f(irc, server, num, source, text)
except Exception as e: except Exception as e:
# Again, we wouldn't want this to crash our service, in case # Again, we wouldn't want this to crash our service, in case

View File

@ -17,7 +17,9 @@ relayusers = defaultdict(dict)
def relayWhoisHandlers(irc, target): def relayWhoisHandlers(irc, target):
user = irc.users[target] user = irc.users[target]
network, remoteuid = getLocalUser(irc, target) orig = getLocalUser(irc, target)
if orig:
network, remoteuid = orig
remotenick = utils.networkobjects[network].users[remoteuid].nick remotenick = utils.networkobjects[network].users[remoteuid].nick
return [320, "%s :is a remote user connected via PyLink Relay. Home " return [320, "%s :is a remote user connected via PyLink Relay. Home "
"network: %s; Home nick: %s" % (user.nick, network, "network: %s; Home nick: %s" % (user.nick, network,