From 645086753574be8da2414fd01bffe4069d7a8f55 Mon Sep 17 00:00:00 2001 From: Sebastien Helleu Date: Fri, 8 Sep 2006 20:20:05 +0000 Subject: Command "/away -all" now allowed when not connected to current server --- src/irc/irc-commands.c | 2 +- src/irc/irc-send.c | 13 ++++++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) (limited to 'src') 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; -- cgit v1.2.3