1
0
mirror of https://github.com/weechat/weechat.git synced 2026-07-07 10:13:12 +02:00

relay/remote: set "input" and "input_pos" only upon buffer creation

This prevents unexpected updates of input on remote buffer whenever something
changes in the buffer, like a local variable, but with the same unchanged
input.
This commit is contained in:
Sébastien Helleu
2024-05-16 07:22:24 +02:00
parent 761d2dec12
commit 1100b0e694
@@ -516,9 +516,16 @@ 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);
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);
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");