summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog1
-rw-r--r--src/irc/irc-commands.c2
-rw-r--r--src/irc/irc-send.c13
-rw-r--r--weechat/ChangeLog1
-rw-r--r--weechat/src/irc/irc-commands.c2
-rw-r--r--weechat/src/irc/irc-send.c13
6 files changed, 28 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 1f29a5a8e..6c02a3af3 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -5,6 +5,7 @@ ChangeLog - 2006-09-08
Version 0.2.1 (under dev!):
+ * command "/away -all" now allowed when not connected to current server
* new signals handled: SIGTERM and SIGHUP (received when terminal is closed):
clean WeeChat quit (send quit to irc servers then quit WeeChat)
* added some new default key bindings for existing keys (for some OS)
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;
diff --git a/weechat/ChangeLog b/weechat/ChangeLog
index 1f29a5a8e..6c02a3af3 100644
--- a/weechat/ChangeLog
+++ b/weechat/ChangeLog
@@ -5,6 +5,7 @@ ChangeLog - 2006-09-08
Version 0.2.1 (under dev!):
+ * command "/away -all" now allowed when not connected to current server
* new signals handled: SIGTERM and SIGHUP (received when terminal is closed):
clean WeeChat quit (send quit to irc servers then quit WeeChat)
* added some new default key bindings for existing keys (for some OS)
diff --git a/weechat/src/irc/irc-commands.c b/weechat/src/irc/irc-commands.c
index a083e07dd..912e7a2b8 100644
--- a/weechat/src/irc/irc-commands.c
+++ b/weechat/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/weechat/src/irc/irc-send.c b/weechat/src/irc/irc-send.c
index b49b6efc9..46284a918 100644
--- a/weechat/src/irc/irc-send.c
+++ b/weechat/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;