From 998bb89c98828dffdc1897c2a45762b83337d878 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Helleu?= Date: Sat, 4 May 2024 13:58:01 +0200 Subject: [PATCH] relay/api: send all nicks when a buffer is opened --- src/plugins/relay/api/relay-api-protocol.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/plugins/relay/api/relay-api-protocol.c b/src/plugins/relay/api/relay-api-protocol.c index d069f4d15..59556e40d 100644 --- a/src/plugins/relay/api/relay-api-protocol.c +++ b/src/plugins/relay/api/relay-api-protocol.c @@ -73,6 +73,7 @@ relay_api_protocol_signal_buffer_cb (const void *pointer, void *data, cJSON *json; long lines; long long buffer_id; + int nicks; const char *ptr_id; char *error; @@ -138,12 +139,21 @@ relay_api_protocol_signal_buffer_cb (const void *pointer, void *data, weechat_buffer_get_string (ptr_buffer, "id")); } - /* we get all lines when a buffer is opened, otherwise none */ - lines = (strcmp (signal, "buffer_opened") == 0) ? LONG_MIN : 0; + /* we get all lines and nicks when a buffer is opened, otherwise none */ + if (strcmp (signal, "buffer_opened") == 0) + { + lines = LONG_MIN; + nicks = 1; + } + else + { + lines = 0; + nicks = 0; + } /* build body with buffer info */ json = relay_api_msg_buffer_to_json ( - ptr_buffer, lines, 0, RELAY_API_DATA(ptr_client, sync_colors)); + ptr_buffer, lines, nicks, RELAY_API_DATA(ptr_client, sync_colors)); /* send to client */ if (json)