Command "/away -all" now allowed when not connected to current server

This commit is contained in:
Sebastien Helleu 2006-09-08 20:20:05 +00:00
parent bd4d543d50
commit 6450867535
6 changed files with 28 additions and 4 deletions

View File

@ -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)

View File

@ -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"

View File

@ -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;

View File

@ -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)

View File

@ -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"

View File

@ -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;