From fdda28799c8f2eb7e10270d26807b378651d5bbf Mon Sep 17 00:00:00 2001 From: James Lu Date: Mon, 19 Dec 2016 00:18:15 -0800 Subject: [PATCH] clientbot: fix message tag parsing --- protocols/clientbot.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/protocols/clientbot.py b/protocols/clientbot.py index f4e4395..c15abb7 100644 --- a/protocols/clientbot.py +++ b/protocols/clientbot.py @@ -341,8 +341,7 @@ class ClientbotWrapperProtocol(Protocol): return idsource - @staticmethod - def parseMessageTags(data): + def parseMessageTags(self, data): """ Parses a message with IRC v3.2 message tags, as described at http://ircv3.net/specs/core/message-tags-3.2.html """ @@ -350,12 +349,13 @@ class ClientbotWrapperProtocol(Protocol): # @aaa=bbb;ccc;example.com/ddd=eee :nick!ident@host.com PRIVMSG me :Hello if data[0].startswith('@'): tagdata = data[0].lstrip('@').split(';') - for tag in tagdata: + for idx, tag in enumerate(tagdata): tag = tag.replace(r'\s', ' ') tag = tag.replace(r'\\', '\\') tag = tag.replace(r'\r', '\r') tag = tag.replace(r'\n', '\n') tag = tag.replace(r'\:', ';') + tagdata[idx] = tag results = self.parseCapabilities(tagdata, fallback=None) log.debug('(%s) parsed message tags %s', self.irc.name, results)