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

relay/api: automatically reconnect to remotes with "autoconnect" enabled after /upgrade

This commit is contained in:
Sébastien Helleu
2024-08-11 14:26:36 +02:00
parent 970aa55f7f
commit 1de8fec2ee
2 changed files with 10 additions and 12 deletions
+9 -12
View File
@@ -303,19 +303,16 @@ weechat_plugin_init (struct t_weechat_plugin *plugin, int argc, char *argv[])
relay_info_init ();
if (weechat_relay_plugin->upgrading)
{
relay_upgrade_load ();
}
else
{
/* check if auto-connect is enabled */
info_auto_connect = weechat_info_get ("auto_connect", NULL);
auto_connect = (info_auto_connect && (strcmp (info_auto_connect, "1") == 0)) ?
1 : 0;
free (info_auto_connect);
if (auto_connect)
relay_remote_auto_connect ();
}
/* check if auto-connect is enabled */
info_auto_connect = weechat_info_get ("auto_connect", NULL);
auto_connect = (info_auto_connect && (strcmp (info_auto_connect, "1") == 0)) ?
1 : 0;
free (info_auto_connect);
if (weechat_relay_plugin->upgrading || auto_connect)
relay_remote_auto_connect ();
relay_hook_timer = weechat_hook_timer (1 * 1000, 0, 0,
&relay_timer_cb, NULL, NULL);