From 75158c47e22174742955b3304b64cdb14c4fc6a2 Mon Sep 17 00:00:00 2001 From: James Lu Date: Fri, 17 Feb 2017 22:18:42 -0800 Subject: [PATCH] clientbot: block PRIVMSG/NOTICE from being routed the wrong way (#405) --- protocols/clientbot.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/protocols/clientbot.py b/protocols/clientbot.py index 4516d79..22f7093 100644 --- a/protocols/clientbot.py +++ b/protocols/clientbot.py @@ -889,6 +889,10 @@ class ClientbotWrapperProtocol(Protocol): # <- :sender NOTICE somenick :afasfsa target = args[0] + if self.irc.isInternalClient(source) or self.irc.isInternalServer(source): + log.warning('(%s) Received %s to %s being routed the wrong way!', self.irc.name, command, target) + return + # We use lowercase channels internally. if utils.isChannel(target): target = self.irc.toLower(target) @@ -896,12 +900,12 @@ class ClientbotWrapperProtocol(Protocol): target = self.irc.nickToUid(target) if target: return {'target': target, 'text': args[1]} + handle_notice = handle_privmsg def handle_quit(self, source, command, args): """Handles incoming QUITs.""" self.quit(source, args[0]) return {'text': args[0]} - handle_notice = handle_privmsg Class = ClientbotWrapperProtocol