3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-12-29 14:12:39 +01:00

protocols: move invite() into IRCS2SProtocol

This commit is contained in:
James Lu 2017-07-06 21:41:03 -07:00
parent 085b4cacbe
commit d149576b4e
3 changed files with 7 additions and 12 deletions

View File

@ -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):

View File

@ -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."""

View File

@ -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,