summaryrefslogtreecommitdiff
path: root/src
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
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')
-rw-r--r--src/fe-common/core/chat-completion.c4
-rw-r--r--src/fe-common/irc/fe-irc-commands.c12
2 files changed, 13 insertions, 3 deletions
diff --git a/src/fe-common/core/chat-completion.c b/src/fe-common/core/chat-completion.c
index 1a16003c..2c23a6ab 100644
--- a/src/fe-common/core/chat-completion.c
+++ b/src/fe-common/core/chat-completion.c
@@ -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);
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);