3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-11-01 01:09:22 +01:00

unreal: add incoming/outgoing INVITE support

This commit is contained in:
James Lu 2015-11-15 21:00:51 -08:00
parent 89e515f513
commit 2ddb72f9ec

View File

@ -220,6 +220,11 @@ class UnrealProtocol(TS6BaseProtocol):
else: else:
raise NotImplementedError("Changing field %r of a client is unsupported by this protocol." % field) raise NotImplementedError("Changing field %r of a client is unsupported by this protocol." % field)
def inviteClient(self, numeric, target, channel):
"""Sends an INVITE from a PyLink client.."""
if not utils.isInternalClient(self.irc, numeric):
raise LookupError('No such PyLink client exists.')
self._send(numeric, 'INVITE %s %s' % (target, channel))
### HANDLERS ### HANDLERS
@ -609,4 +614,12 @@ class UnrealProtocol(TS6BaseProtocol):
self.irc.users[target].realname = newgecos = args[1] self.irc.users[target].realname = newgecos = args[1]
return {'target': target, 'newgecos': newgecos} return {'target': target, 'newgecos': newgecos}
def handle_invite(self, numeric, command, args):
"""Handles incoming INVITEs."""
# <- :GL INVITE PyLink-devel :#a
target = self._getNick(args[0])
channel = args[1].lower()
# We don't actually need to process this; it's just something plugins/hooks can use
return {'target': target, 'channel': channel}
Class = UnrealProtocol Class = UnrealProtocol