From 8010eeece3b029dfaaff15721a123b53ca490fa7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Helleu?= Date: Sat, 10 Aug 2024 14:29:30 +0200 Subject: [PATCH] relay/api: add support of time displayed in remote client buffers --- CHANGELOG.md | 2 +- src/plugins/relay/api/relay-api-protocol.c | 1 + src/plugins/relay/api/remote/relay-remote-event.c | 7 +++++-- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 65b6d3e82..23e6973b9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,7 +18,7 @@ - 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, add support of hidden buffers in remote client ([#2159](https://github.com/weechat/weechat/issues/2159)) -- relay/api: add field "time_displayed" in GET /api/buffers +- relay/api: add field "time_displayed" in GET /api/buffers, add support of time displayed in remote client buffers - 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/relay-api-protocol.c b/src/plugins/relay/api/relay-api-protocol.c index b7bfa96e8..edca0ba16 100644 --- a/src/plugins/relay/api/relay-api-protocol.c +++ b/src/plugins/relay/api/relay-api-protocol.c @@ -95,6 +95,7 @@ relay_api_protocol_signal_buffer_cb (const void *pointer, void *data, || (strcmp (signal, "buffer_renamed") == 0) || (strcmp (signal, "buffer_title_changed") == 0) || (strcmp (signal, "buffer_modes_changed") == 0) + || (strcmp (signal, "buffer_time_for_each_line_changed") == 0) || (strncmp (signal, "buffer_localvar_", 16) == 0) || (strcmp (signal, "buffer_cleared") == 0) || (strcmp (signal, "buffer_closing") == 0) diff --git a/src/plugins/relay/api/remote/relay-remote-event.c b/src/plugins/relay/api/remote/relay-remote-event.c index 3460b0ca8..70479bfbd 100644 --- a/src/plugins/relay/api/remote/relay-remote-event.c +++ b/src/plugins/relay/api/remote/relay-remote-event.c @@ -842,8 +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, hidden, nicklist; - int nicklist_case_sensitive, nicklist_display_groups; + int number, hidden, nicklist, nicklist_case_sensitive; + int nicklist_display_groups, time_displayed; int apply_props, input_position, input_multiline; if (!event->json) @@ -864,6 +864,7 @@ RELAY_REMOTE_EVENT_CALLBACK(buffer) JSON_GET_BOOL(event->json, nicklist); JSON_GET_BOOL(event->json, nicklist_case_sensitive); JSON_GET_BOOL(event->json, nicklist_display_groups); + JSON_GET_BOOL(event->json, time_displayed); buffer_props = weechat_hashtable_new (32, WEECHAT_HASHTABLE_STRING, @@ -887,6 +888,8 @@ RELAY_REMOTE_EVENT_CALLBACK(buffer) (nicklist_case_sensitive) ? "1" : "0"); weechat_hashtable_set (buffer_props, "nicklist_display_groups", (nicklist_display_groups) ? "1" : "0"); + weechat_hashtable_set (buffer_props, "time_for_each_line", + (time_displayed) ? "1" : "0"); /* extra properties for relay */ weechat_hashtable_set (buffer_props,