From 116a3d504294b82a06b0a5224dfdbb8e782521e2 Mon Sep 17 00:00:00 2001 From: Sebastien Helleu Date: Tue, 18 Nov 2008 09:34:22 +0100 Subject: Allow command "/away -all" on weechat core buffer --- src/plugins/irc/irc-command.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/plugins/irc/irc-command.c b/src/plugins/irc/irc-command.c index 8cc26f261..b4a312037 100644 --- a/src/plugins/irc/irc-command.c +++ b/src/plugins/irc/irc-command.c @@ -381,16 +381,13 @@ irc_command_away (void *data, struct t_gui_buffer *buffer, int argc, char **argv, char **argv_eol) { IRC_GET_SERVER(buffer); - if (!ptr_server) - return WEECHAT_RC_ERROR; /* make C compiler happy */ (void) data; - weechat_buffer_set (NULL, "hotlist", "-"); - if ((argc >= 2) && (weechat_strcasecmp (argv[1], "-all") == 0)) { + weechat_buffer_set (NULL, "hotlist", "-"); for (ptr_server = irc_servers; ptr_server; ptr_server = ptr_server->next_server) { @@ -398,11 +395,17 @@ irc_command_away (void *data, struct t_gui_buffer *buffer, int argc, irc_command_away_server (ptr_server, (argc > 2) ? argv_eol[2] : NULL); } + weechat_buffer_set (NULL, "hotlist", "+"); } else + { + if (!ptr_server) + return WEECHAT_RC_ERROR; + + weechat_buffer_set (NULL, "hotlist", "-"); irc_command_away_server (ptr_server, argv_eol[1]); - - weechat_buffer_set (NULL, "hotlist", "+"); + weechat_buffer_set (NULL, "hotlist", "+"); + } return WEECHAT_RC_OK; } -- cgit v1.2.3