3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-12-24 19:52:53 +01:00

nefarious: implement WHOIS handling & outbound numerics

This commit is contained in:
James Lu 2016-04-17 20:32:21 -07:00
parent 933029824c
commit 29d2fea3b2

View File

@ -350,6 +350,12 @@ class P10Protocol(Protocol):
self._send(numeric, 'NICK %s %s' % (newnick, int(time.time())))
self.irc.users[numeric].nick = newnick
def numeric(self, source, numeric, target, text):
"""Sends raw numerics from a server to a remote client. This is used for WHOIS
replies."""
# <- AB 311 AyAAA GL ~gl nefarious.midnight.vpn * :realname
self._send(source, '%s %s %s' % (numeric, target, text))
def notice(self, numeric, target, text):
"""Sends a NOTICE from a PyLink client."""
if not self.irc.isInternalClient(numeric):
@ -1041,4 +1047,9 @@ class P10Protocol(Protocol):
return {'text': text}
def handle_whois(self, numeric, command, args):
"""Handles incoming WHOIS requests."""
# <- ABAAA W Ay :PyLink-devel
return {'target': self._getUid(args[-1])}
Class = P10Protocol