diff options
-rw-r--r-- | src/fe-common/core/chat-completion.c | 4 | ||||
-rw-r--r-- | src/fe-common/irc/fe-irc-commands.c | 12 |
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); |