3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-11-24 03:29:28 +01:00

Move numeric() into IRCS2SProtocol

This commit is contained in:
James Lu 2017-07-05 02:36:34 -07:00
parent 56c8b90362
commit 694b5018fc
2 changed files with 7 additions and 8 deletions

View File

@ -373,6 +373,13 @@ class IRCS2SProtocol(IRCCommonProtocol):
# handle_part() does that just fine.
self.handle_part(target, 'KICK', [channel])
def numeric(self, source, numeric, target, text):
"""Sends raw numerics from a server to a remote client. This is used for WHOIS replies."""
# Mangle the target for IRCds that require it.
target = self._expandPUID(target)
self._send_with_prefix(source, '%s %s %s' % (numeric, target, text))
def part(self, client, channel, reason=None):
"""Sends a part from a PyLink client."""
channel = self.to_lower(channel)

View File

@ -110,14 +110,6 @@ class TS6BaseProtocol(IRCS2SProtocol):
### OUTGOING COMMANDS
def numeric(self, source, numeric, target, text):
"""Sends raw numerics from a server to a remote client, used for WHOIS
replies."""
# Mangle the target for IRCds that require it.
target = self._expandPUID(target)
self._send_with_prefix(source, '%s %s %s' % (numeric, target, text))
def kill(self, numeric, target, reason):
"""Sends a kill from a PyLink client/server."""