From e5b6eab2f689cf41be30be2711136e82f476bc55 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Helleu?= Date: Fri, 9 Aug 2024 18:06:42 +0200 Subject: [PATCH] relay/api: do not reset input text on existing buffers when reconnecting to remote --- CHANGELOG.md | 1 + .../relay/api/remote/relay-remote-event.c | 17 +++++++---------- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2cfa5ede6..42a464303 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -62,6 +62,7 @@ - relay/api: fix timezone of dates sent to clients ([#2151](https://github.com/weechat/weechat/issues/2151)) - relay/api: clear lines and nicklist on all remote buffers upon successful connection to the remote ([#2161](https://github.com/weechat/weechat/issues/2161)) - relay/api: fix buffers synchronization with existing buffers that have been renamed on remote in the meanwhile ([#2169](https://github.com/weechat/weechat/issues/2169)) +- relay/api: do not reset input text on existing buffers when reconnecting to remote - relay/api: fix "body_type" returned when lines or nicks of a buffer are requested - relay/api: fix read of one buffer line - relay: fix websocket permessage-deflate extension when the client doesn't send the max window bits parameters ([#1549](https://github.com/weechat/weechat/issues/1549)) diff --git a/src/plugins/relay/api/remote/relay-remote-event.c b/src/plugins/relay/api/remote/relay-remote-event.c index 20903c1c7..646881d19 100644 --- a/src/plugins/relay/api/remote/relay-remote-event.c +++ b/src/plugins/relay/api/remote/relay-remote-event.c @@ -784,16 +784,6 @@ RELAY_REMOTE_EVENT_CALLBACK(buffer) weechat_hashtable_set (buffer_props, "title", title); weechat_hashtable_set (buffer_props, "modes", modes); weechat_hashtable_set (buffer_props, "input_prompt", input_prompt); - if (!event->buffer) - { - /* - * set input content and position only when the buffer is created; - * subsequent updates will be handled via the "input" callback - */ - 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, "input_multiline", (input_multiline) ? "1" : "0"); weechat_hashtable_set (buffer_props, "nicklist", (nicklist) ? "1" : "0"); @@ -825,6 +815,13 @@ RELAY_REMOTE_EVENT_CALLBACK(buffer) ptr_buffer = weechat_buffer_search ("relay", full_name); if (!ptr_buffer) { + /* + * set input content and position only when the buffer is created; + * subsequent updates will be handled via the "input" callback + */ + 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); ptr_buffer = weechat_buffer_new_props ( full_name, buffer_props, &relay_remote_event_buffer_input_cb, NULL, NULL,