summaryrefslogtreecommitdiff
path: root/src/plugins
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2024-05-04 13:58:01 +0200
committerSébastien Helleu <flashcode@flashtux.org>2024-05-04 13:58:01 +0200
commit998bb89c98828dffdc1897c2a45762b83337d878 (patch)
tree085c835de46de2de0d208a797a68a8052c5e5cd5 /src/plugins
parentccf23ae51e8ca98aaf53d49dc5890442565fb951 (diff)
downloadweechat-998bb89c98828dffdc1897c2a45762b83337d878.zip
relay/api: send all nicks when a buffer is opened
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/relay/api/relay-api-protocol.c16
1 files 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)