1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-30 23:06:38 +02:00

irc: defer the auto-connection to servers with a timer (closes #279, task #13038)

This commit is contained in:
Sébastien Helleu
2015-01-06 21:05:38 +01:00
parent ca5aa6695f
commit 8f668bb18c
2 changed files with 27 additions and 6 deletions
+2
View File
@@ -73,6 +73,8 @@ https://weechat.org/files/releasenotes/ReleaseNotes-devel.html[release notes]
* api: fix truncated process output in hook_process() (closes #266)
* api: fix crash when reading config options with NULL value (closes #238)
* tests: fix compilation of tests with clang (closes #275)
* irc: defer the auto-connection to servers with a timer
(closes #279, task #13038)
* irc: add missing server options "sasl_timeout" and "notify" in output of
/server listfull
* irc: use option irc.look.nick_mode_empty to display nick prefix in bar item
+25 -6
View File
@@ -4415,16 +4415,19 @@ irc_server_reconnect (struct t_irc_server *server)
}
/*
* Auto-connects to servers (called at startup).
*
* If auto_connect == 1, auto-connects to all servers with flag "autoconnect".
* If auto_connect == 0, auto-connect to temporary servers only.
* Callback for auto-connect to servers (called at startup).
*/
void
irc_server_auto_connect (int auto_connect)
int
irc_server_auto_connect_timer_cb (void *data, int remaining_calls)
{
struct t_irc_server *ptr_server;
int auto_connect;
/* make C compiler happy */
(void) remaining_calls;
auto_connect = (int)data;
for (ptr_server = irc_servers; ptr_server;
ptr_server = ptr_server->next_server)
@@ -4436,6 +4439,22 @@ irc_server_auto_connect (int auto_connect)
irc_server_reconnect_schedule (ptr_server);
}
}
return WEECHAT_RC_OK;
}
/*
* Auto-connects to servers (called at startup).
*
* If auto_connect == 1, auto-connects to all servers with flag "autoconnect".
* If auto_connect == 0, auto-connect to temporary servers only.
*/
void
irc_server_auto_connect (int auto_connect)
{
weechat_hook_timer (1, 0, 1, &irc_server_auto_connect_timer_cb,
(auto_connect) ? (void *)1 : (void *)0);
}
/*