summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2024-05-07 21:32:55 +0200
committerSébastien Helleu <flashcode@flashtux.org>2024-05-07 21:38:24 +0200
commit92dfd2425fe0a1f3baaf74d7157ce2c2eae1b9f2 (patch)
tree93790717b9219c98be64726fa9a11455a6f3f002
parentbe621205e94f1d43253119afe59fe87bd542bdb2 (diff)
downloadweechat-92dfd2425fe0a1f3baaf74d7157ce2c2eae1b9f2.zip
relay/remote: set buffer input and cursor position on buffer event
-rw-r--r--src/plugins/relay/api/remote/relay-remote-event.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/plugins/relay/api/remote/relay-remote-event.c b/src/plugins/relay/api/remote/relay-remote-event.c
index db8847293..7dc7a5453 100644
--- a/src/plugins/relay/api/remote/relay-remote-event.c
+++ b/src/plugins/relay/api/remote/relay-remote-event.c
@@ -477,11 +477,12 @@ RELAY_REMOTE_EVENT_CALLBACK(buffer)
struct t_relay_remote_event event_line;
cJSON *json_obj, *json_keys, *json_key, *json_key_name, *json_key_command;
cJSON *json_lines, *json_line, *json_nicklist_root;
- const char *name, *short_name, *type, *title, *ptr_key, *ptr_command;
+ const char *name, *short_name, *type, *title, *input, *ptr_key;
+ const char *ptr_command;
char *full_name, str_number[64], *property;
long long id;
int number, nicklist, nicklist_case_sensitive, nicklist_display_groups;
- int apply_props;
+ int apply_props, input_position;
if (!event->json)
return WEECHAT_RC_OK;
@@ -492,6 +493,8 @@ RELAY_REMOTE_EVENT_CALLBACK(buffer)
JSON_GET_NUM(event->json, number, -1);
JSON_GET_STR(event->json, type);
JSON_GET_STR(event->json, title);
+ JSON_GET_STR(event->json, input);
+ JSON_GET_NUM(event->json, input_position, 0);
JSON_GET_BOOL(event->json, nicklist);
JSON_GET_BOOL(event->json, nicklist_case_sensitive);
JSON_GET_BOOL(event->json, nicklist_display_groups);
@@ -508,6 +511,9 @@ RELAY_REMOTE_EVENT_CALLBACK(buffer)
weechat_hashtable_set (buffer_props, "type", type);
weechat_hashtable_set (buffer_props, "short_name", short_name);
weechat_hashtable_set (buffer_props, "title", title);
+ weechat_hashtable_set (buffer_props, "input", input);
+ snprintf (str_number, sizeof (str_number), "%d", input_position);
+ weechat_hashtable_set (buffer_props, "input_pos", str_number);
weechat_hashtable_set (buffer_props, "nicklist", (nicklist) ? "1" : "0");
weechat_hashtable_set (buffer_props, "nicklist_case_sensitive",
(nicklist_case_sensitive) ? "1" : "0");