1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-26 12:56:37 +02:00

irc: restore input prompt after upgrade on server and channel buffers

This commit is contained in:
Sébastien Helleu
2024-05-12 01:30:09 +02:00
parent 464b019929
commit c1083d022d
+36
View File
@@ -983,6 +983,40 @@ irc_upgrade_read_cb (const void *pointer, void *data,
return WEECHAT_RC_OK;
}
/*
* Set buffer prompt on IRC buffers where it's not set and if it should be.
*
* This is needed when upgrading from WeeChat < 4.3.0 to Weechat ≥ 4.3.0,
* where the "input_prompt" has been added in buffer.
*/
void
irc_upgrade_set_buffer_prompt ()
{
struct t_irc_server *ptr_server;
struct t_irc_channel *ptr_channel;
for (ptr_server = irc_servers; ptr_server;
ptr_server = ptr_server->next_server)
{
if (ptr_server->buffer)
{
if (!weechat_buffer_get_string (ptr_server->buffer, "input_prompt"))
{
irc_server_set_buffer_input_prompt (ptr_server);
}
else
{
for (ptr_channel = ptr_server->channels; ptr_channel;
ptr_channel = ptr_channel->next_channel)
{
irc_channel_set_buffer_input_prompt (ptr_server, ptr_channel);
}
}
}
}
}
/*
* Loads irc upgrade file.
*
@@ -1019,5 +1053,7 @@ irc_upgrade_load ()
(ptr_filter && ptr_filter[0]) ? ptr_filter : "*");
}
irc_upgrade_set_buffer_prompt ();
return rc;
}