diff options
author | Sebastien Helleu <flashcode@flashtux.org> | 2008-11-18 09:34:22 +0100 |
---|---|---|
committer | Sebastien Helleu <flashcode@flashtux.org> | 2008-11-18 09:34:22 +0100 |
commit | 116a3d504294b82a06b0a5224dfdbb8e782521e2 (patch) | |
tree | 47276c15055da91478d635844cf8f09c2029689a /src | |
parent | c463b912cc77a1e0ab76cb8ba32124f29dd78903 (diff) | |
download | weechat-116a3d504294b82a06b0a5224dfdbb8e782521e2.zip |
Allow command "/away -all" on weechat core buffer
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/irc/irc-command.c | 15 |
1 files changed, 9 insertions, 6 deletions
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; } |