diff options
author | Sébastien Helleu <flashcode@flashtux.org> | 2021-06-22 20:38:13 +0200 |
---|---|---|
committer | Sébastien Helleu <flashcode@flashtux.org> | 2021-06-24 21:02:03 +0200 |
commit | b1cf12700d6c928e0550d97a9c1da7b188f81dc1 (patch) | |
tree | a923ed6fd2b5634693f97a449446f35745d84d3c /src/plugins/irc/irc-protocol.c | |
parent | 8ea1ee06e5ac18a000788851f807cb4fad3e076c (diff) | |
download | weechat-b1cf12700d6c928e0550d97a9c1da7b188f81dc1.zip |
irc: add keys/values with tags in output of irc_message_parse_to_hashtable (issue #1654)
Key is "tag_xxx" (where "xxx" is the name of tag) and value is the unescaped
tag value.
Diffstat (limited to 'src/plugins/irc/irc-protocol.c')
-rw-r--r-- | src/plugins/irc/irc-protocol.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/plugins/irc/irc-protocol.c b/src/plugins/irc/irc-protocol.c index 53631e1b2..140a662c0 100644 --- a/src/plugins/irc/irc-protocol.c +++ b/src/plugins/irc/irc-protocol.c @@ -6826,7 +6826,6 @@ irc_protocol_recv_command (struct t_irc_server *server, message_colors_decoded = NULL; argv = NULL; argv_eol = NULL; - hash_tags = NULL; date = 0; ptr_msg_after_tags = irc_message; @@ -6841,11 +6840,16 @@ irc_protocol_recv_command (struct t_irc_server *server, pos_space - (irc_message + 1)); if (tags) { - hash_tags = irc_tag_parse (tags); + hash_tags = weechat_hashtable_new (32, + WEECHAT_HASHTABLE_STRING, + WEECHAT_HASHTABLE_STRING, + NULL, NULL); if (hash_tags) { + irc_tag_parse (tags, hash_tags, NULL); date = irc_protocol_parse_time ( weechat_hashtable_get (hash_tags, "time")); + weechat_hashtable_free (hash_tags); } free (tags); } @@ -7033,6 +7037,4 @@ end: weechat_string_free_split (argv); if (argv_eol) weechat_string_free_split (argv_eol); - if (hash_tags) - weechat_hashtable_free (hash_tags); } |