From 0f269da9b8a80c72cf21774bdb180771114882ee Mon Sep 17 00:00:00 2001 From: James Lu Date: Sun, 15 Nov 2015 21:09:40 -0800 Subject: [PATCH] unreal: add outgoing KNOCK In Unreal, KNOCKs are simply specially formatted notices sent from the orginating user's server. No special inbound hook is used to handle this as a result. --- protocols/unreal.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/protocols/unreal.py b/protocols/unreal.py index e0c9929..16e4eef 100644 --- a/protocols/unreal.py +++ b/protocols/unreal.py @@ -226,6 +226,16 @@ class UnrealProtocol(TS6BaseProtocol): raise LookupError('No such PyLink client exists.') self._send(numeric, 'INVITE %s %s' % (target, channel)) + def knockClient(self, numeric, target, text): + """Sends a KNOCK from a PyLink client.""" + # KNOCKs in UnrealIRCd are actually just specially formatted NOTICEs, + # sent to all ops in a channel. + # <- :unreal.midnight.vpn NOTICE @#test :[Knock] by GL|!gl@hidden-1C620195 (test) + assert utils.isChannel(target), "Can only knock on channels!" + sender = utils.clientToServer(self.irc, numeric) + s = '[Knock] by %s (%s)' % (utils.getHostmask(self.irc, numeric), text) + self._send(sender, 'NOTICE @%s :%s' % (target, s)) + ### HANDLERS def connect(self):