diff --git a/modules/line_handler.py b/modules/line_handler.py index 04ac39cb..df948612 100644 --- a/modules/line_handler.py +++ b/modules/line_handler.py @@ -10,8 +10,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", "server-time", "cap-notify", - "batch", "draft/labeled-response", "draft/rename"} + "draft/message-tags-0.2", "draft/message-tags-0.3", "server-time", + "cap-notify", "batch", "draft/labeled-response", "draft/rename"} class Module(ModuleManager.BaseModule): def _handle(self, server, line): diff --git a/src/utils/irc.py b/src/utils/irc.py index c22cfd25..f68af6ec 100644 --- a/src/utils/irc.py +++ b/src/utils/irc.py @@ -83,10 +83,16 @@ def parse_line(line: str) -> IRCLine: command = None if line[0] == "@": - tags_prefix, line = line[1:].split(" ", 1) - for tag in filter(None, tags_prefix.split(";")): - tag, _, value = tag.partition("=") - tags[tag] = value + if line[1] == "{": + tags = json.loads(line[2:]) + else: + tags_prefix, line = line[1:].split(" ", 1) + for tag in filter(None, tags_prefix.split(";")): + tag, sep, value = tag.partition("=") + if sep: + tags[tag] = value + else: + tags[tag] = None line, _, arbitrary_split = line.partition(" :") arbitrary = arbitrary_split or None