summaryrefslogtreecommitdiff
path: root/src/plugins
diff options
context:
space:
mode:
authorSebastien Helleu <flashcode@flashtux.org>2012-04-08 10:11:29 +0200
committerSebastien Helleu <flashcode@flashtux.org>2012-04-08 10:11:29 +0200
commit2224fe796e6a2fcc4829da0b6f1fcf1fd169db0f (patch)
treebdfe4803563c5789c0eb0635108404a9d974d8a6 /src/plugins
parent902c0903d3fb069d27896c6e377b265f81ea0002 (diff)
downloadweechat-2224fe796e6a2fcc4829da0b6f1fcf1fd169db0f.zip
irc: add option "-pending" for command /disconnect (cancel auto-reconnection on servers currently reconnecting) (task #11985)
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/irc/irc-command.c25
1 files changed, 20 insertions, 5 deletions
diff --git a/src/plugins/irc/irc-command.c b/src/plugins/irc/irc-command.c
index 6348bd800..1e2e2a2a1 100644
--- a/src/plugins/irc/irc-command.c
+++ b/src/plugins/irc/irc-command.c
@@ -1461,6 +1461,19 @@ irc_command_disconnect (void *data, struct t_gui_buffer *buffer, int argc,
}
}
}
+ else if (weechat_strcasecmp (argv[1], "-pending") == 0)
+ {
+ for (ptr_server = irc_servers; ptr_server;
+ ptr_server = ptr_server->next_server)
+ {
+ if (!ptr_server->is_connected
+ && (ptr_server->reconnect_start != 0))
+ {
+ if (!irc_command_disconnect_one_server (ptr_server, reason))
+ disconnect_ok = 0;
+ }
+ }
+ }
else
{
ptr_server = irc_server_search (argv[1]);
@@ -4994,11 +5007,13 @@ irc_command_init ()
NULL, &irc_command_die, NULL);
weechat_hook_command ("disconnect",
N_("disconnect from one or all IRC servers"),
- N_("[<server>|-all [<reason>]]"),
- N_("server: server name to disconnect\n"
- " -all: disconnect from all servers\n"
- "reason: reason for quit"),
- "%(irc_servers)|-all",
+ N_("[<server>|-all|-pending [<reason>]]"),
+ N_(" server: server name to disconnect\n"
+ " -all: disconnect from all servers\n"
+ "-pending: cancel auto-reconnection on servers "
+ "currently reconnecting\n"
+ " reason: reason for quit"),
+ "%(irc_servers)|-all|-pending",
&irc_command_disconnect, NULL);
weechat_hook_command ("halfop",
N_("give channel half-operator status to "