3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-11-27 21:19:31 +01:00

ircs2s_common: make parse_message_tags() a classmethod

This commit is contained in:
James Lu 2019-09-10 18:04:23 -07:00
parent 19f7ba38b3
commit 188d0f647e

View File

@ -137,7 +137,8 @@ class IRCCommonProtocol(IRCNetwork):
prefixsearch = re.search(r'\(([A-Za-z]+)\)(.*)', args) prefixsearch = re.search(r'\(([A-Za-z]+)\)(.*)', args)
return dict(zip(prefixsearch.group(1), prefixsearch.group(2))) return dict(zip(prefixsearch.group(1), prefixsearch.group(2)))
def parse_message_tags(self, data): @classmethod
def parse_message_tags(cls, data):
""" """
Parses IRCv3.2 message tags from a message, as described at http://ircv3.net/specs/core/message-tags-3.2.html Parses IRCv3.2 message tags from a message, as described at http://ircv3.net/specs/core/message-tags-3.2.html
@ -155,8 +156,7 @@ class IRCCommonProtocol(IRCNetwork):
tag = tag.replace(r'\:', ';') tag = tag.replace(r'\:', ';')
tagdata[idx] = tag tagdata[idx] = tag
results = self.parse_isupport(tagdata, fallback=None) results = cls.parse_isupport(tagdata, fallback=None)
log.debug('(%s) parsed message tags %s', self.name, results)
return results return results
return {} return {}