From bb2387ec38c65ba9b1fdc811a3e99b24017bd4a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Helleu?= Date: Sat, 10 Aug 2024 12:55:17 +0200 Subject: [PATCH] relay/api: add support of hidden buffers in remote client (issue #2159) --- CHANGELOG.md | 2 +- src/plugins/relay/api/remote/relay-remote-event.c | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 48b852bba..f8ddf2700 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,7 +17,7 @@ - core: allow buffer id in commands `/buffer` and `/print`, in addition to number and name - core: allow mask in command `/item refresh` - relay: enable websocket extension "permessage-deflate" with "api" relay only ([#1549](https://github.com/weechat/weechat/issues/1549)) -- relay/api: add field "hidden" in GET /api/buffers ([#2159](https://github.com/weechat/weechat/issues/2159)) +- relay/api: add field "hidden" in GET /api/buffers, add support of hidden buffers in remote client ([#2159](https://github.com/weechat/weechat/issues/2159)) - relay/weechat: add line id in buffer lines sent to clients - relay: display connection status in output of commands `/remote list` and `/remote listfull` - relay: add option `reconnect` in command `/remote` ([#2160](https://github.com/weechat/weechat/issues/2160)) diff --git a/src/plugins/relay/api/remote/relay-remote-event.c b/src/plugins/relay/api/remote/relay-remote-event.c index 927f6340c..3460b0ca8 100644 --- a/src/plugins/relay/api/remote/relay-remote-event.c +++ b/src/plugins/relay/api/remote/relay-remote-event.c @@ -842,7 +842,8 @@ RELAY_REMOTE_EVENT_CALLBACK(buffer) const char *ptr_key, *ptr_command; char *full_name, str_number[64], str_local_var[1024], *property; long long id; - int number, nicklist, nicklist_case_sensitive, nicklist_display_groups; + int number, hidden, nicklist; + int nicklist_case_sensitive, nicklist_display_groups; int apply_props, input_position, input_multiline; if (!event->json) @@ -853,6 +854,7 @@ RELAY_REMOTE_EVENT_CALLBACK(buffer) JSON_GET_STR(event->json, short_name); JSON_GET_NUM(event->json, number, -1); JSON_GET_STR(event->json, type); + JSON_GET_BOOL(event->json, hidden); JSON_GET_STR(event->json, title); JSON_GET_STR(event->json, modes); JSON_GET_STR(event->json, input_prompt); @@ -873,6 +875,7 @@ RELAY_REMOTE_EVENT_CALLBACK(buffer) /* buffer base properties */ weechat_hashtable_set (buffer_props, "type", type); + weechat_hashtable_set (buffer_props, "hidden", (hidden) ? "1" : "0"); weechat_hashtable_set (buffer_props, "short_name", short_name); weechat_hashtable_set (buffer_props, "title", title); weechat_hashtable_set (buffer_props, "modes", modes);