1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-30 14:56:39 +02:00

relay/api: add field "modes" in GET /api/buffers

This commit is contained in:
Sébastien Helleu
2024-05-12 09:48:04 +02:00
parent dcb8fcb6ed
commit 3bfb7d7f04
3 changed files with 5 additions and 0 deletions
+1
View File
@@ -385,6 +385,7 @@ relay_api_msg_buffer_to_json (struct t_gui_buffer *buffer,
lines = lines_free;
MSG_ADD_STR_PTR("type", ptr_string);
MSG_ADD_HDATA_STR_COLORS("title", "title");
MSG_ADD_HDATA_STR_COLORS("modes", "modes");
MSG_ADD_HDATA_STR_COLORS("input_prompt", "input_prompt");
MSG_ADD_HDATA_STR("input", "input_buffer");
MSG_ADD_HDATA_VAR(Number, "input_position", integer, "input_buffer_pos");
@@ -94,6 +94,7 @@ relay_api_protocol_signal_buffer_cb (const void *pointer, void *data,
|| (strcmp (signal, "buffer_unhidden") == 0)
|| (strcmp (signal, "buffer_renamed") == 0)
|| (strcmp (signal, "buffer_title_changed") == 0)
|| (strcmp (signal, "buffer_modes_changed") == 0)
|| (strncmp (signal, "buffer_localvar_", 16) == 0)
|| (strcmp (signal, "buffer_cleared") == 0)
|| (strcmp (signal, "buffer_closing") == 0)
@@ -432,6 +432,7 @@ TEST(RelayApiProtocolWithClient, CbBuffers)
WEE_CHECK_OBJ_NUM(1, json, "number");
WEE_CHECK_OBJ_STR("formatted", json, "type");
WEE_CHECK_OBJ_STRN("WeeChat", 7, json, "title");
WEE_CHECK_OBJ_STR("", json, "modes");
WEE_CHECK_OBJ_STR("", json, "input_prompt");
WEE_CHECK_OBJ_STR("", json, "input");
WEE_CHECK_OBJ_NUM(0, json, "input_position");
@@ -458,6 +459,7 @@ TEST(RelayApiProtocolWithClient, CbBuffers)
WEE_CHECK_OBJ_NUM(1, json, "number");
WEE_CHECK_OBJ_STR("formatted", json, "type");
WEE_CHECK_OBJ_STRN("WeeChat", 7, json, "title");
WEE_CHECK_OBJ_STR("", json, "modes");
WEE_CHECK_OBJ_STR("test_prompt", json, "input_prompt");
WEE_CHECK_OBJ_STR("test", json, "input");
WEE_CHECK_OBJ_NUM(4, json, "input_position");
@@ -485,6 +487,7 @@ TEST(RelayApiProtocolWithClient, CbBuffers)
WEE_CHECK_OBJ_NUM(1, json, "number");
WEE_CHECK_OBJ_STR("formatted", json, "type");
WEE_CHECK_OBJ_STRN("WeeChat", 7, json, "title");
WEE_CHECK_OBJ_STR("", json, "modes");
WEE_CHECK_OBJ_STR("", json, "input_prompt");
WEE_CHECK_OBJ_STR("", json, "input");
WEE_CHECK_OBJ_NUM(0, json, "input_position");