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 /doc/en | |
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 'doc/en')
-rw-r--r-- | doc/en/weechat_plugin_api.en.adoc | 14 | ||||
-rw-r--r-- | doc/en/weechat_scripting.en.adoc | 18 |
2 files changed, 20 insertions, 12 deletions
diff --git a/doc/en/weechat_plugin_api.en.adoc b/doc/en/weechat_plugin_api.en.adoc index 3ce99dbcc..e2e089d0c 100644 --- a/doc/en/weechat_plugin_api.en.adoc +++ b/doc/en/weechat_plugin_api.en.adoc @@ -15581,12 +15581,14 @@ if (hashtable_in) weechat_hashtable_set ( hashtable_in, "message", - "@time=2015-06-27T16:40:35.000Z :nick!user@host PRIVMSG #weechat :hello!"); + "@time=2015-06-27T16:40:35.000Z;tag2=value\\sspace :nick!user@host PRIVMSG #weechat :hello!"); hashtable_out = weechat_info_get_hashtable ("irc_message_parse", hashtable_in); /* * now hashtable_out has following keys/values: - * "tags" : "time=2015-06-27T16:40:35.000Z" + * "tags" : "time=2015-06-27T16:40:35.000Z;tag2=value\\sspace" + * "tag_time" : "2015-06-27T16:40:35.000Z" + * "tag_tag2" : "value space" * "message_without_tags": ":nick!user@host PRIVMSG #weechat :hello!" * "nick" : "nick" * "user" : "user" @@ -15595,10 +15597,10 @@ if (hashtable_in) * "channel" : "#weechat" * "arguments" : "#weechat :hello!" * "text" : "hello!" - * "pos_command" : "47" - * "pos_arguments" : "55" - * "pos_channel" : "55" - * "pos_text" : "65" + * "pos_command" : "65" + * "pos_arguments" : "73" + * "pos_channel" : "73" + * "pos_text" : "83" */ weechat_hashtable_free (hashtable_in); weechat_hashtable_free (hashtable_out); diff --git a/doc/en/weechat_scripting.en.adoc b/doc/en/weechat_scripting.en.adoc index 7b1c5fb16..ffdf378de 100644 --- a/doc/en/weechat_scripting.en.adoc +++ b/doc/en/weechat_scripting.en.adoc @@ -1277,6 +1277,10 @@ The result is a hashtable with following keys The tags in message (can be empty). | `+time=2015-06-27T16:40:35.000Z+` +| tag_xxx | 3.3 | + Unescaped value of tag "xxx" (one key per tag). | + `+2015-06-27T16:40:35.000Z+` + | message_without_tags | 0.4.0 | The message without the tags (the same as message if there are no tags). | `+:nick!user@host PRIVMSG #weechat :hello!+` @@ -1333,10 +1337,12 @@ The result is a hashtable with following keys ---- dict = weechat.info_get_hashtable( "irc_message_parse", - {"message": "@time=2015-06-27T16:40:35.000Z :nick!user@host PRIVMSG #weechat :hello!"}) + {"message": "@time=2015-06-27T16:40:35.000Z;tag2=value\\sspace :nick!user@host PRIVMSG #weechat :hello!"}) # dict == { -# "tags": "time=2015-06-27T16:40:35.000Z", +# "tags": "time=2015-06-27T16:40:35.000Z;tag2=value\\sspace", +# "tag_time": "2015-06-27T16:40:35.000Z", +# "tag_tag2": "value space", # "message_without_tags": ":nick!user@host PRIVMSG #weechat :hello!", # "nick": "nick", # "user": "user", @@ -1345,10 +1351,10 @@ dict = weechat.info_get_hashtable( # "channel": "#weechat", # "arguments": "#weechat :hello!", # "text": "hello!", -# "pos_command": "47", -# "pos_arguments": "55", -# "pos_channel": "55", -# "pos_text": "65", +# "pos_command": "65", +# "pos_arguments": "73", +# "pos_channel": "73", +# "pos_text": "83", # } ---- |