draft/message-tags-0.3 (JSON tags) was rejected
This commit is contained in:
parent
807021ecc4
commit
81d82413d4
2 changed files with 8 additions and 13 deletions
|
@ -6,9 +6,8 @@ RE_MODES = re.compile(r"[-+]\w+")
|
|||
|
||||
CAPABILITIES = {"multi-prefix", "chghost", "invite-notify", "account-tag",
|
||||
"account-notify", "extended-join", "away-notify", "userhost-in-names",
|
||||
"draft/message-tags-0.2", "draft/message-tags-0.3", "server-time",
|
||||
"cap-notify", "batch", "draft/labeled-response", "draft/rename",
|
||||
"echo-message", "draft/setname"}
|
||||
"draft/message-tags-0.2", "server-time", "cap-notify", "batch",
|
||||
"draft/labeled-response", "draft/rename", "echo-message", "draft/setname"}
|
||||
|
||||
LABELED_BATCH = {
|
||||
"labeled-response": "label",
|
||||
|
|
|
@ -116,16 +116,12 @@ def parse_line(line: str) -> IRCParsedLine:
|
|||
if line[0] == "@":
|
||||
tags_prefix, line = line[1:].split(" ", 1)
|
||||
|
||||
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(";")):
|
||||
tag, sep, value = tag.partition("=")
|
||||
if sep:
|
||||
tags[tag] = message_tag_unescape(value)
|
||||
else:
|
||||
tags[tag] = None
|
||||
for tag in filter(None, tags_prefix.split(";")):
|
||||
tag, sep, value = tag.partition("=")
|
||||
if sep:
|
||||
tags[tag] = message_tag_unescape(value)
|
||||
else:
|
||||
tags[tag] = None
|
||||
|
||||
line, trailing_separator, trailing_split = line.partition(" :")
|
||||
|
||||
|
|
Loading…
Reference in a new issue