1
0
mirror of https://github.com/irssi/irssi.git synced 2024-11-03 04:27:19 -05:00

/RECONNECT ALL - reconnects to all servers in reconnection queue

git-svn-id: http://svn.irssi.org/repos/irssi/trunk@1253 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
Timo Sirainen 2001-02-19 04:50:58 +00:00 committed by cras
parent 4550204783
commit a191df786d

View File

@ -293,6 +293,32 @@ static RECONNECT_REC *reconnect_find_tag(int tag)
return NULL;
}
static void reconnect_all(void)
{
GSList *list;
SERVER_CONNECT_REC *conn;
RECONNECT_REC *rec;
/* first move reconnects to another list so if server_connect()
fails and goes to reconnection list again, we won't get stuck
here forever */
list = NULL;
while (reconnects != NULL) {
rec = reconnects->data;
list = g_slist_append(list, rec->conn);
server_reconnect_destroy(rec, FALSE);
}
while (list != NULL) {
conn = list->data;
CHAT_PROTOCOL(conn)->server_connect(conn);
list = g_slist_remove(list, conn);
}
}
/* SYNTAX: RECONNECT <tag> */
static void cmd_reconnect(const char *data, SERVER_REC *server)
{
@ -315,6 +341,12 @@ static void cmd_reconnect(const char *data, SERVER_REC *server)
return;
}
if (g_strcasecmp(data, "all") == 0) {
/* reconnect all servers in reconnect queue */
reconnect_all();
return;
}
if (*data == '\0') {
/* reconnect to first server in reconnection list */
if (reconnects == NULL)