summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSebastien Helleu <flashcode@flashtux.org>2006-09-08 20:20:05 +0000
committerSebastien Helleu <flashcode@flashtux.org>2006-09-08 20:20:05 +0000
commit645086753574be8da2414fd01bffe4069d7a8f55 (patch)
treee8583c5279246b41580e0aec81de5869d48857a2 /src
parentbd4d543d507eae887e72d5503e6bc6e1aa1a76de (diff)
downloadweechat-645086753574be8da2414fd01bffe4069d7a8f55.zip
Command "/away -all" now allowed when not connected to current server
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;