mirror of
https://github.com/weechat/weechat.git
synced 2026-06-26 21:06:38 +02:00
relay/api: add field "hidden" in GET /api/buffers (issue #2159)
This commit is contained in:
@@ -17,6 +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/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))
|
||||
|
||||
@@ -489,6 +489,7 @@ HTTP/1.1 200 OK
|
||||
"short_name": "weechat",
|
||||
"number": 1,
|
||||
"type": "formatted",
|
||||
"hidden": false,
|
||||
"title": "WeeChat 4.2.0-dev (C) 2003-2023 - https://weechat.org/",
|
||||
"modes": "",
|
||||
"input_prompt": "",
|
||||
@@ -510,6 +511,7 @@ HTTP/1.1 200 OK
|
||||
"short_name": "libera",
|
||||
"number": 2,
|
||||
"type": "formatted",
|
||||
"hidden": false,
|
||||
"title": "IRC: irc.libera.chat/6697 (2001:4b7a:a008::6667)",
|
||||
"modes": "",
|
||||
"input_prompt": "",
|
||||
@@ -538,6 +540,7 @@ HTTP/1.1 200 OK
|
||||
"short_name": "#weechat",
|
||||
"number": 3,
|
||||
"type": "formatted",
|
||||
"hidden": false,
|
||||
"title": "Welcome to the WeeChat official support channel",
|
||||
"modes": "+nt",
|
||||
"input_prompt": "\u001b[92m@\u001b[96malice\u001b[48;5;22m(\u001b[39mi\u001b[48;5;22m)",
|
||||
@@ -583,6 +586,7 @@ HTTP/1.1 200 OK
|
||||
"short_name": "weechat",
|
||||
"number": 1,
|
||||
"type": "formatted",
|
||||
"hidden": false,
|
||||
"title": "WeeChat 4.2.0-dev (C) 2003-2023 - https://weechat.org/",
|
||||
"modes": "",
|
||||
"input_prompt": "",
|
||||
@@ -636,6 +640,7 @@ HTTP/1.1 200 OK
|
||||
"short_name": "#weechat",
|
||||
"number": 3,
|
||||
"type": "formatted",
|
||||
"hidden": false,
|
||||
"title": "Welcome to the WeeChat official support channel",
|
||||
"modes": "+nt",
|
||||
"input_prompt": "\u001b[92m@\u001b[96malice\u001b[48;5;22m(\u001b[39mi\u001b[48;5;22m)",
|
||||
@@ -743,6 +748,7 @@ HTTP/1.1 200 OK
|
||||
"short_name": "",
|
||||
"number": 4,
|
||||
"type": "free",
|
||||
"hidden": false,
|
||||
"title": "\u001b[96m1/\u001b[36m3565 | Filter: \u001b[93m* | Sort: \u001b[97m~name | Key(input): alt+space=toggle boolean, alt+'-'(-)=subtract 1 or set, alt+'+'(+)=add 1 or append, alt+f,alt+r(r)=reset, alt+f,alt+u(u)=unset, alt+enter(s)=set, alt+f,alt+n(n)=set new value, alt+f,alt+a(a)=append, alt+','=mark/unmark, shift+down=mark and move down, shift+up=move up and mark, ($)=refresh, ($$)=unmark/refresh, (m)=mark matching options, (u)=unmark matching options, alt+p(p)=toggle plugins desc, alt+v(v)=toggle help bar, ctrl+x(x)=switch format, (q)=close buffer",
|
||||
"modes": "",
|
||||
"input_prompt": "",
|
||||
@@ -1533,6 +1539,7 @@ Example: new buffer: channel `#weechat` has been joined:
|
||||
"short_name": "",
|
||||
"number": 4,
|
||||
"type": "formatted",
|
||||
"hidden": false,
|
||||
"title": "",
|
||||
"modes": "+nt",
|
||||
"input_prompt": "\u001b[92m@\u001b[96malice\u001b[48;5;22m(\u001b[39mi\u001b[48;5;22m)",
|
||||
|
||||
@@ -380,6 +380,7 @@ relay_api_msg_buffer_to_json (struct t_gui_buffer *buffer,
|
||||
if (weechat_strcmp (ptr_string, "free") == 0)
|
||||
lines = lines_free;
|
||||
MSG_ADD_STR_PTR("type", ptr_string);
|
||||
MSG_ADD_HDATA_VAR(Bool, "hidden", integer, "hidden");
|
||||
MSG_ADD_HDATA_STR_COLORS("title", "title");
|
||||
MSG_ADD_HDATA_STR_COLORS("modes", "modes");
|
||||
MSG_ADD_HDATA_STR_COLORS("input_prompt", "input_prompt");
|
||||
|
||||
@@ -592,6 +592,10 @@ components:
|
||||
- free
|
||||
description: the buffer type
|
||||
example: formatted
|
||||
hidden:
|
||||
type: boolean
|
||||
description: buffer is hidden
|
||||
example: false
|
||||
title:
|
||||
type: string
|
||||
description: the buffer title (can contain colors)
|
||||
@@ -656,6 +660,7 @@ components:
|
||||
- short_name
|
||||
- number
|
||||
- type
|
||||
- hidden
|
||||
- title
|
||||
- modes
|
||||
- input_prompt
|
||||
|
||||
@@ -146,6 +146,7 @@ TEST(RelayApiMsg, BufferToJson)
|
||||
WEE_CHECK_OBJ_STR("weechat", json, "short_name");
|
||||
WEE_CHECK_OBJ_NUM(1, json, "number");
|
||||
WEE_CHECK_OBJ_STR("formatted", json, "type");
|
||||
WEE_CHECK_OBJ_BOOL(0, json, "hidden");
|
||||
WEE_CHECK_OBJ_STRN("WeeChat", 7, json, "title");
|
||||
WEE_CHECK_OBJ_BOOL(0, json, "nicklist");
|
||||
WEE_CHECK_OBJ_BOOL(0, json, "nicklist_case_sensitive");
|
||||
@@ -170,6 +171,16 @@ TEST(RelayApiMsg, BufferToJson)
|
||||
POINTERS_EQUAL(NULL, cJSON_GetObjectItem (json, "nicks"));
|
||||
cJSON_Delete (json);
|
||||
|
||||
gui_buffer_hide (gui_buffers);
|
||||
|
||||
json = relay_api_msg_buffer_to_json (gui_buffers, 0L, 0L, 0, RELAY_API_COLORS_ANSI);
|
||||
CHECK(json);
|
||||
CHECK(cJSON_IsObject (json));
|
||||
WEE_CHECK_OBJ_BOOL(1, json, "hidden");
|
||||
cJSON_Delete (json);
|
||||
|
||||
gui_buffer_unhide (gui_buffers);
|
||||
|
||||
/* buffer with 2 lines, without nicks */
|
||||
json = relay_api_msg_buffer_to_json (gui_buffers, 2L, 0L, 0, RELAY_API_COLORS_ANSI);
|
||||
CHECK(json);
|
||||
|
||||
Reference in New Issue
Block a user