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 = json.loads(tags_prefix)
else:
tags_split = list(filter(None, tags_prefix.split(";")))
tags_split = [message_tag_unescape(tag) for tag in tags_split]
for tag in tags_split:
for tag in filter(None, tags_prefix.split(";")):
tag, sep, value = tag.partition("=")
if sep:
tags[tag] = value
tags[tag] = message_tag_unescape(value)
else:
tags[tag] = None