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

inspircd: support insp3 INVITE

This commit is contained in:
James Lu 2019-05-31 18:28:28 -07:00
parent 722881bc33
commit 762b47120d
2 changed files with 13 additions and 1 deletions

View File

@ -346,6 +346,18 @@ class InspIRCdProtocol(TS6BaseProtocol):
else:
self._send_with_prefix(self.sid, 'PUSH %s ::%s %s %s %s' % (target, source, numeric, target, text))
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.')
if self.proto_ver >= 1205: # insp3
# Note: insp3 supports optionally sending an invite expiration (after the TS argument),
# but we don't use / expose that feature yet.
self._send_with_prefix(source, 'INVITE %s %s %d' % (target, channel, self._channels[channel].ts))
else: # insp2
self._send_with_prefix(source, 'INVITE %s %s' % (target, channel))
def away(self, source, text):
"""Sends an AWAY message from a PyLink client. <text> can be an empty string
to unset AWAY status."""

View File

@ -352,7 +352,7 @@ class IRCS2SProtocol(IRCCommonProtocol):
return [sender, command, parsed_args]
def invite(self, source, target, channel):
"""Sends an INVITE from a PyLink client.."""
"""Sends an INVITE from a PyLink client."""
if not self.is_internal_client(source):
raise LookupError('No such PyLink client exists.')