1
0
mirror of https://github.com/irssi/irssi.git synced 2024-12-04 14:46:39 -05:00

/ACTION supports -servertag now and tab completion works with it like with

/MSG.


git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2484 dbcabf3a-b0e7-0310-adc4-f8d773084564
This commit is contained in:
Timo Sirainen 2002-02-16 13:33:17 +00:00 committed by cras
parent 6f136674e9
commit 1dc3dafe0d
2 changed files with 13 additions and 3 deletions

View File

@ -914,8 +914,10 @@ void chat_completion_init(void)
signal_add("complete word", (SIGNAL_FUNC) sig_complete_word);
signal_add("complete command msg", (SIGNAL_FUNC) sig_complete_msg);
signal_add("complete command query", (SIGNAL_FUNC) sig_complete_msg);
signal_add("complete command action", (SIGNAL_FUNC) sig_complete_msg);
signal_add("complete erase command msg", (SIGNAL_FUNC) sig_erase_complete_msg);
signal_add("complete erase command query", (SIGNAL_FUNC) sig_erase_complete_msg);
signal_add("complete erase command action", (SIGNAL_FUNC) sig_erase_complete_msg);
signal_add("complete command connect", (SIGNAL_FUNC) sig_complete_connect);
signal_add("complete command server", (SIGNAL_FUNC) sig_complete_connect);
signal_add("complete command topic", (SIGNAL_FUNC) sig_complete_topic);
@ -940,8 +942,10 @@ void chat_completion_deinit(void)
signal_remove("complete word", (SIGNAL_FUNC) sig_complete_word);
signal_remove("complete command msg", (SIGNAL_FUNC) sig_complete_msg);
signal_remove("complete command query", (SIGNAL_FUNC) sig_complete_msg);
signal_remove("complete command action", (SIGNAL_FUNC) sig_complete_msg);
signal_remove("complete erase command msg", (SIGNAL_FUNC) sig_erase_complete_msg);
signal_remove("complete erase command query", (SIGNAL_FUNC) sig_erase_complete_msg);
signal_remove("complete erase command action", (SIGNAL_FUNC) sig_erase_complete_msg);
signal_remove("complete command connect", (SIGNAL_FUNC) sig_complete_connect);
signal_remove("complete command server", (SIGNAL_FUNC) sig_complete_connect);
signal_remove("complete command topic", (SIGNAL_FUNC) sig_complete_topic);

View File

@ -69,20 +69,26 @@ static void cmd_me(const char *data, IRC_SERVER_REC *server, WI_ITEM_REC *item)
item->name, data);
}
/* SYNTAX: ACTION <target> <message> */
/* SYNTAX: ACTION [-<server tag>] <target> <message> */
static void cmd_action(const char *data, IRC_SERVER_REC *server)
{
GHashTable *optlist;
char *target, *text;
void *free_arg;
CMD_IRC_SERVER(server);
if (!cmd_get_params(data, &free_arg, 2 | PARAM_FLAG_GETREST,
&target, &text))
if (!cmd_get_params(data, &free_arg, 2 | PARAM_FLAG_OPTIONS |
PARAM_FLAG_UNKNOWN_OPTIONS | PARAM_FLAG_GETREST,
"action", &optlist, &target, &text))
return;
if (*target == '\0' || *text == '\0')
cmd_param_error(CMDERR_NOT_ENOUGH_PARAMS);
server = IRC_SERVER(cmd_options_get_server("action", optlist, SERVER(server)));
if (server == NULL || !server->connected)
cmd_param_error(CMDERR_NOT_CONNECTED);
irc_send_cmdv(server, "PRIVMSG %s :\001ACTION %s\001", target, text);
target = skip_target(target);