summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/irc/irc-commands.c2
-rw-r--r--src/irc/irc-send.c13
2 files changed, 13 insertions, 2 deletions
diff --git a/src/irc/irc-commands.c b/src/irc/irc-commands.c
index a083e07dd..912e7a2b8 100644
--- a/src/irc/irc-commands.c
+++ b/src/irc/irc-commands.c
@@ -47,7 +47,7 @@ t_irc_command irc_commands[] =
N_("[-all] [message]"),
N_(" -all: toggle away status on all connected servers\n"
"message: message for away (if no message is given, away status is removed)"),
- "-all", 0, MAX_ARGS, 1, 1, NULL, irc_cmd_send_away, NULL },
+ "-all", 0, MAX_ARGS, 1, 0, NULL, irc_cmd_send_away, NULL },
{ "ban", N_("bans nicks or hosts"),
N_("[channel] [nickname [nickname ...]]"),
N_(" channel: channel for ban\n"
diff --git a/src/irc/irc-send.c b/src/irc/irc-send.c
index b49b6efc9..46284a918 100644
--- a/src/irc/irc-send.c
+++ b/src/irc/irc-send.c
@@ -348,7 +348,18 @@ irc_cmd_send_away (t_irc_server *server, t_irc_channel *channel,
}
}
else
- irc_send_away (server, arguments);
+ {
+ if (server->is_connected)
+ irc_send_away (server, arguments);
+ else
+ {
+ irc_display_prefix (NULL, NULL, PREFIX_ERROR);
+ gui_printf_nolog (NULL,
+ _("%s command \"%s\" needs a server connection!\n"),
+ WEECHAT_ERROR, "away");
+ return -1;
+ }
+ }
gui_status_draw (buffer, 1);
gui_add_hotlist = 1;