From 2c7b5669bd761672544035ccf7679db0899a6ab0 Mon Sep 17 00:00:00 2001 From: James Lu Date: Sun, 31 Jul 2016 20:30:51 -0700 Subject: [PATCH] protocols: strip leading prefix modes before checking whether msg target is a channel --- protocols/nefarious.py | 6 ++++-- protocols/ts6_common.py | 5 ++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/protocols/nefarious.py b/protocols/nefarious.py index 5fbfbf1..46a68ff 100644 --- a/protocols/nefarious.py +++ b/protocols/nefarious.py @@ -1112,9 +1112,11 @@ class P10Protocol(IRCS2SProtocol): # <- ABAAA O AyAAA :notice text target = args[0] - # We use lowercase channels internally, but uppercase UIDs. - if utils.isChannel(target): + # We use lower case channels internally, but mixed case UIDs. + stripped_target = target.lstrip(''.join(self.irc.prefixmodes.values())) + if utils.isChannel(stripped_target): target = self.irc.toLower(target) + return {'target': target, 'text': args[1]} handle_notice = handle_privmsg diff --git a/protocols/ts6_common.py b/protocols/ts6_common.py index 6d39154..666e5aa 100644 --- a/protocols/ts6_common.py +++ b/protocols/ts6_common.py @@ -350,9 +350,12 @@ class TS6BaseProtocol(IRCS2SProtocol): # <- :70MAAAAAA PRIVMSG #dev :afasfsa # <- :70MAAAAAA NOTICE 0ALAAAAAA :afasfsa target = args[0] + # We use lowercase channels internally, but uppercase UIDs. - if utils.isChannel(target): + stripped_target = target.lstrip(''.join(self.irc.prefixmodes.values())) + if utils.isChannel(stripped_target): target = self.irc.toLower(target) + return {'target': target, 'text': args[1]} handle_notice = handle_privmsg