From 2ddb72f9ec695331778e6cfd928fd52446d1709d Mon Sep 17 00:00:00 2001 From: James Lu Date: Sun, 15 Nov 2015 21:00:51 -0800 Subject: [PATCH] unreal: add incoming/outgoing INVITE support --- protocols/unreal.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/protocols/unreal.py b/protocols/unreal.py index d7ced73..e0c9929 100644 --- a/protocols/unreal.py +++ b/protocols/unreal.py @@ -220,6 +220,11 @@ class UnrealProtocol(TS6BaseProtocol): else: 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 @@ -609,4 +614,12 @@ class UnrealProtocol(TS6BaseProtocol): self.irc.users[target].realname = newgecos = args[1] 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