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

irc: set "input_multiline" to 1 in buffers only if capability draft/multiline is enabled (issue #1923)

This commit is contained in:
Sébastien Helleu
2023-05-14 10:43:10 +02:00
parent 537d18ede5
commit c31af39ada
5 changed files with 46 additions and 4 deletions
+11 -3
View File
@@ -1021,6 +1021,7 @@ IRC_PROTOCOL_CALLBACK(cap)
if (!server->checking_cap_list)
{
weechat_hashtable_remove_all (server->cap_list);
irc_server_buffer_set_input_multiline (server, 0);
server->checking_cap_list = 1;
}
@@ -1051,6 +1052,8 @@ IRC_PROTOCOL_CALLBACK(cap)
{
weechat_hashtable_set (server->cap_list,
str_name, pos_value + 1);
if (strcmp (str_name, "draft/multiline") == 0)
irc_server_buffer_set_input_multiline (server, 1);
free (str_name);
}
}
@@ -1058,6 +1061,8 @@ IRC_PROTOCOL_CALLBACK(cap)
{
weechat_hashtable_set (server->cap_list,
caps_enabled[j], NULL);
if (strcmp (caps_enabled[j], "draft/multiline") == 0)
irc_server_buffer_set_input_multiline (server, 1);
}
}
weechat_string_free_split (caps_enabled);
@@ -1109,9 +1114,10 @@ IRC_PROTOCOL_CALLBACK(cap)
weechat_string_dyn_concat (str_caps_disabled,
caps_supported[j] + 1,
-1);
weechat_hashtable_remove (server->cap_list,
caps_supported[j] + 1);
if (strcmp (caps_supported[j] + 1, "draft/multiline") == 0)
irc_server_buffer_set_input_multiline (server, 0);
}
else
{
@@ -1120,10 +1126,10 @@ IRC_PROTOCOL_CALLBACK(cap)
weechat_string_dyn_concat (str_caps_enabled,
caps_supported[j],
-1);
weechat_hashtable_set (server->cap_list,
caps_supported[j], NULL);
if (strcmp (caps_supported[j], "draft/multiline") == 0)
irc_server_buffer_set_input_multiline (server, 1);
if (strcmp (caps_supported[j], "sasl") == 0)
sasl_to_do = 1;
}
@@ -1280,6 +1286,8 @@ IRC_PROTOCOL_CALLBACK(cap)
{
weechat_hashtable_remove (server->cap_ls, caps_removed[j]);
weechat_hashtable_remove (server->cap_list, caps_removed[j]);
if (strcmp (caps_removed[j], "draft/multiline") == 0)
irc_server_buffer_set_input_multiline (server, 0);
}
weechat_string_free_split (caps_removed);
}