Technically, we only need to unescape non-json message-tag *values*

This commit is contained in:
jesopo 2018-11-08 11:52:53 +00:00
parent 0c6d54f5fd
commit 03cae696c1

View file

@ -97,12 +97,10 @@ def parse_line(line: str) -> IRCLine:
tags_prefix = message_tag_unescape(tags_prefix) tags_prefix = message_tag_unescape(tags_prefix)
tags = json.loads(tags_prefix) tags = json.loads(tags_prefix)
else: else:
tags_split = list(filter(None, tags_prefix.split(";"))) for tag in filter(None, tags_prefix.split(";")):
tags_split = [message_tag_unescape(tag) for tag in tags_split]
for tag in tags_split:
tag, sep, value = tag.partition("=") tag, sep, value = tag.partition("=")
if sep: if sep:
tags[tag] = value tags[tag] = message_tag_unescape(value)
else: else:
tags[tag] = None tags[tag] = None