aboutsummaryrefslogtreecommitdiff
path: root/src/utils
diff options
context:
space:
mode:
authorGravatar jesopo2018-11-08 11:43:32 +0000
committerGravatar jesopo2018-11-08 11:43:32 +0000
commit0c6d54f5fd23f160e6ea167f92f85ee246283a26 (patch)
tree693cbf3067dfb3d1efc3e574e77efe49384e3e58 /src/utils
parentUnescape message-tags as per spec Escaping Rules (diff)
signature
Only mesage-tag unescape non-json tags after we split on ";"
Diffstat (limited to 'src/utils')
-rw-r--r--src/utils/irc.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/utils/irc.py b/src/utils/irc.py
index 7b82e791..01c382a2 100644
--- a/src/utils/irc.py
+++ b/src/utils/irc.py
@@ -92,12 +92,14 @@ def parse_line(line: str) -> IRCLine:
if line[0] == "@":
tags_prefix, line = line[1:].split(" ", 1)
- tags_prefix = message_tag_unescape(tags_prefix)
if tags_prefix[0] == "{":
+ tags_prefix = message_tag_unescape(tags_prefix)
tags = json.loads(tags_prefix)
else:
- for tag in filter(None, tags_prefix.split(";")):
+ tags_split = list(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("=")
if sep:
tags[tag] = value