From d149576b4e02c927de4199a5dfd6dfab43175ab9 Mon Sep 17 00:00:00 2001 From: James Lu Date: Thu, 6 Jul 2017 21:41:03 -0700 Subject: [PATCH] protocols: move invite() into IRCS2SProtocol --- protocols/inspircd.py | 6 ------ protocols/ircs2s_common.py | 7 +++++++ protocols/unreal.py | 6 ------ 3 files changed, 7 insertions(+), 12 deletions(-) diff --git a/protocols/inspircd.py b/protocols/inspircd.py index 21777b4..d218cc6 100644 --- a/protocols/inspircd.py +++ b/protocols/inspircd.py @@ -243,12 +243,6 @@ class InspIRCdProtocol(TS6BaseProtocol): self.channels[target].topic = text self.channels[target].topicset = True - def invite(self, numeric, target, channel): - """Sends an INVITE from a PyLink client..""" - if not self.is_internal_client(numeric): - raise LookupError('No such PyLink client exists.') - self._send_with_prefix(numeric, 'INVITE %s %s' % (target, channel)) - def knock(self, numeric, target, text): """Sends a KNOCK from a PyLink client.""" if not self.is_internal_client(numeric): diff --git a/protocols/ircs2s_common.py b/protocols/ircs2s_common.py index 99cddca..a5987a9 100644 --- a/protocols/ircs2s_common.py +++ b/protocols/ircs2s_common.py @@ -352,6 +352,13 @@ class IRCS2SProtocol(IRCCommonProtocol): if parsed_args is not None: return [sender, command, parsed_args] + def invite(self, source, target, channel): + """Sends an INVITE from a PyLink client..""" + if not self.is_internal_client(source): + raise LookupError('No such PyLink client exists.') + + self._send_with_prefix(source, 'INVITE %s %s' % (self._expandPUID(target), channel)) + def kick(self, numeric, channel, target, reason=None): """Sends kicks from a PyLink client/server.""" diff --git a/protocols/unreal.py b/protocols/unreal.py index 24707eb..c3dd7a4 100644 --- a/protocols/unreal.py +++ b/protocols/unreal.py @@ -300,12 +300,6 @@ class UnrealProtocol(TS6BaseProtocol): self.call_hooks([self.sid, 'CHGNAME', {'target': target, 'newgecos': text}]) - def invite(self, numeric, target, channel): - """Sends an INVITE from a PyLink client..""" - if not self.is_internal_client(numeric): - raise LookupError('No such PyLink client exists.') - self._send_with_prefix(numeric, 'INVITE %s %s' % (target, channel)) - def knock(self, numeric, target, text): """Sends a KNOCK from a PyLink client.""" # KNOCKs in UnrealIRCd are actually just specially formatted NOTICEs,