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

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

This commit is contained in:
Sébastien Helleu
2024-08-10 13:58:58 +02:00
parent 41ab22554c
commit 24734c4fe0
7 changed files with 27 additions and 0 deletions
+1
View File
@@ -18,6 +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/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))
+7
View File
@@ -499,6 +499,7 @@ HTTP/1.1 200 OK
"nicklist": false,
"nicklist_case_sensitive": false,
"nicklist_display_groups": true,
"time_displayed": true,
"local_variables": {
"plugin": "core",
"name": "weechat"
@@ -521,6 +522,7 @@ HTTP/1.1 200 OK
"nicklist": false,
"nicklist_case_sensitive": false,
"nicklist_display_groups": true,
"time_displayed": true,
"local_variables": {
"plugin": "irc",
"name": "server.libera",
@@ -550,6 +552,7 @@ HTTP/1.1 200 OK
"nicklist": true,
"nicklist_case_sensitive": false,
"nicklist_display_groups": false,
"time_displayed": true,
"local_variables": {
"plugin": "irc",
"name": "libera.#weechat",
@@ -596,6 +599,7 @@ HTTP/1.1 200 OK
"nicklist": false,
"nicklist_case_sensitive": false,
"nicklist_display_groups": true,
"time_displayed": true,
"local_variables": {
"plugin": "core",
"name": "weechat"
@@ -650,6 +654,7 @@ HTTP/1.1 200 OK
"nicklist": true,
"nicklist_case_sensitive": false,
"nicklist_display_groups": false,
"time_displayed": true,
"local_variables": {
"plugin": "irc",
"name": "libera.#weechat",
@@ -758,6 +763,7 @@ HTTP/1.1 200 OK
"nicklist": false,
"nicklist_case_sensitive": false,
"nicklist_display_groups": true,
"time_displayed": true,
"local_variables": {
"plugin": "fset",
"name": "fset",
@@ -1549,6 +1555,7 @@ Example: new buffer: channel `#weechat` has been joined:
"nicklist": true,
"nicklist_case_sensitive": false,
"nicklist_display_groups": false,
"time_displayed": true,
"local_variables": {
"plugin": "irc",
"name": "libera.#test",
+7
View File
@@ -510,6 +510,7 @@ HTTP/1.1 200 OK
"nicklist": false,
"nicklist_case_sensitive": false,
"nicklist_display_groups": true,
"time_displayed": true,
"local_variables": {
"plugin": "core",
"name": "weechat"
@@ -531,6 +532,7 @@ HTTP/1.1 200 OK
"nicklist": false,
"nicklist_case_sensitive": false,
"nicklist_display_groups": true,
"time_displayed": true,
"local_variables": {
"plugin": "irc",
"name": "server.libera",
@@ -559,6 +561,7 @@ HTTP/1.1 200 OK
"nicklist": true,
"nicklist_case_sensitive": false,
"nicklist_display_groups": false,
"time_displayed": true,
"local_variables": {
"plugin": "irc",
"name": "libera.#weechat",
@@ -605,6 +608,7 @@ HTTP/1.1 200 OK
"nicklist": false,
"nicklist_case_sensitive": false,
"nicklist_display_groups": true,
"time_displayed": true,
"local_variables": {
"plugin": "core",
"name": "weechat"
@@ -658,6 +662,7 @@ HTTP/1.1 200 OK
"nicklist": true,
"nicklist_case_sensitive": false,
"nicklist_display_groups": false,
"time_displayed": true,
"local_variables": {
"plugin": "irc",
"name": "libera.#weechat",
@@ -765,6 +770,7 @@ HTTP/1.1 200 OK
"nicklist": false,
"nicklist_case_sensitive": false,
"nicklist_display_groups": true,
"time_displayed": true,
"local_variables": {
"plugin": "fset",
"name": "fset",
@@ -1571,6 +1577,7 @@ Exemple : nouveau tampon : le canal `#weechat` a été rejoint :
"nicklist": true,
"nicklist_case_sensitive": false,
"nicklist_display_groups": false,
"time_displayed": true,
"local_variables": {
"plugin": "irc",
"name": "libera.#test",
+2
View File
@@ -378,6 +378,8 @@ extern void gui_buffer_set_title (struct t_gui_buffer *buffer,
const char *new_title);
extern void gui_buffer_set_modes (struct t_gui_buffer *buffer,
const char *new_modes);
extern void gui_buffer_set_time_for_each_line (struct t_gui_buffer *buffer,
int time_for_each_line);
extern void gui_buffer_set_highlight_words (struct t_gui_buffer *buffer,
const char *new_highlight_words);
extern void gui_buffer_set_highlight_disable_regex (struct t_gui_buffer *buffer,
+1
View File
@@ -390,6 +390,7 @@ relay_api_msg_buffer_to_json (struct t_gui_buffer *buffer,
MSG_ADD_HDATA_VAR(Bool, "nicklist", integer, "nicklist");
MSG_ADD_HDATA_VAR(Bool, "nicklist_case_sensitive", integer, "nicklist_case_sensitive");
MSG_ADD_HDATA_VAR(Bool, "nicklist_display_groups", integer, "nicklist_display_groups");
MSG_ADD_HDATA_VAR(Bool, "time_displayed", integer, "time_for_each_line");
/* local_variables */
json_local_vars = cJSON_CreateObject ();
@@ -633,6 +633,10 @@ components:
type: boolean
description: groups are displayed in nicklist
example: false
time_displayed:
type: boolean
description: time is displayed on each line
example: true
local_variables:
type: object
description: the buffer local variables
@@ -670,6 +674,7 @@ components:
- nicklist
- nicklist_case_sensitive
- nicklist_display_groups
- time_displayed
- local_variables
- keys
Key:
@@ -156,6 +156,7 @@ TEST(RelayApiMsg, BufferToJson)
WEE_CHECK_OBJ_BOOL(0, json, "nicklist");
WEE_CHECK_OBJ_BOOL(0, json, "nicklist_case_sensitive");
WEE_CHECK_OBJ_BOOL(1, json, "nicklist_display_groups");
WEE_CHECK_OBJ_BOOL(1, json, "time_displayed");
json_local_vars = cJSON_GetObjectItem (json, "local_variables");
CHECK(json_local_vars);
CHECK(cJSON_IsObject (json_local_vars));
@@ -177,14 +178,17 @@ TEST(RelayApiMsg, BufferToJson)
cJSON_Delete (json);
gui_buffer_hide (gui_buffers);
gui_buffer_set_time_for_each_line (gui_buffers, 0);
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");
WEE_CHECK_OBJ_BOOL(0, json, "time_displayed");
cJSON_Delete (json);
gui_buffer_unhide (gui_buffers);
gui_buffer_set_time_for_each_line (gui_buffers, 1);
/* buffer with 2 lines, without nicks */
json = relay_api_msg_buffer_to_json (gui_buffers, 2L, 0L, 0, RELAY_API_COLORS_ANSI);