summaryrefslogtreecommitdiff
path: root/src/fe-common/irc
diff options
context:
space:
mode:
authorTimo Sirainen <cras@irssi.org>2002-02-16 13:33:17 +0000
committercras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564>2002-02-16 13:33:17 +0000
commit1dc3dafe0dbef286e120f53548380de15dce8a4c (patch)
tree4ee092dcd7040ace2a2899e244877acadb68cf24 /src/fe-common/irc
parent6f136674e9cccb1c3518ad5620980902f59337e0 (diff)
downloadirssi-1dc3dafe0dbef286e120f53548380de15dce8a4c.zip
/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
Diffstat (limited to 'src/fe-common/irc')
-rw-r--r--src/fe-common/irc/fe-irc-commands.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/fe-common/irc/fe-irc-commands.c b/src/fe-common/irc/fe-irc-commands.c
index cc8f8a65..264ec32f 100644
--- a/src/fe-common/irc/fe-irc-commands.c
+++ b/src/fe-common/irc/fe-irc-commands.c
@@ -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);