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

protocols: strip leading prefix modes before checking whether msg target is a channel

(cherry picked from commit 2c7b5669bd)
This commit is contained in:
James Lu 2016-07-31 20:30:51 -07:00
parent f061a2fc68
commit 9a59c68370
2 changed files with 8 additions and 3 deletions

View File

@ -1115,9 +1115,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

View File

@ -357,9 +357,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