From 226a567562cf1f9a95ea08383838e11c20fb98c3 Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Fri, 20 Aug 2004 00:03:40 +0000 Subject: Recode patch by decadix/senneth git-svn-id: http://svn.irssi.org/repos/irssi/trunk@3283 dbcabf3a-b0e7-0310-adc4-f8d773084564 --- src/fe-common/irc/fe-irc-commands.c | 29 +++++++++++++++++++++++------ 1 file changed, 23 insertions(+), 6 deletions(-) (limited to 'src/fe-common/irc') diff --git a/src/fe-common/irc/fe-irc-commands.c b/src/fe-common/irc/fe-irc-commands.c index b1752d9d..0c948dee 100644 --- a/src/fe-common/irc/fe-irc-commands.c +++ b/src/fe-common/irc/fe-irc-commands.c @@ -22,6 +22,7 @@ #include "module-formats.h" #include "signals.h" #include "misc.h" +#include "recode.h" #include "special-vars.h" #include "settings.h" @@ -56,6 +57,9 @@ static const char *skip_target(const char *target) /* SYNTAX: ME */ static void cmd_me(const char *data, IRC_SERVER_REC *server, WI_ITEM_REC *item) { + const char *target; + char *recoded; + CMD_IRC_SERVER(server); if (!IS_IRC_ITEM(item)) return; @@ -63,11 +67,16 @@ static void cmd_me(const char *data, IRC_SERVER_REC *server, WI_ITEM_REC *item) if (server == NULL || !server->connected) cmd_return_error(CMDERR_NOT_CONNECTED); - signal_emit("message irc own_action", 3, server, data, + target = window_item_get_target(item); + recoded = recode_out(data, target); + + signal_emit("message irc own_action", 3, server, recoded, item->visible_name); irc_send_cmdv(server, "PRIVMSG %s :\001ACTION %s\001", - window_item_get_target(item), data); + target, recoded); + + g_free(recoded); } /* SYNTAX: ACTION [-] */ @@ -75,6 +84,7 @@ static void cmd_action(const char *data, IRC_SERVER_REC *server) { GHashTable *optlist; const char *target, *text; + char *recoded; void *free_arg; CMD_IRC_SERVER(server); @@ -90,10 +100,13 @@ static void cmd_action(const char *data, IRC_SERVER_REC *server) if (server == NULL || !server->connected) cmd_param_error(CMDERR_NOT_CONNECTED); - irc_send_cmdv(server, "PRIVMSG %s :\001ACTION %s\001", target, text); + recoded = recode_out(text, target); + irc_send_cmdv(server, "PRIVMSG %s :\001ACTION %s\001", target, recoded); target = skip_target(target); - signal_emit("message irc own_action", 3, server, text, target); + signal_emit("message irc own_action", 3, server, recoded, target); + + g_free(recoded); cmd_params_free(free_arg); } @@ -101,6 +114,7 @@ static void cmd_notice(const char *data, IRC_SERVER_REC *server, WI_ITEM_REC *item) { const char *target, *msg; + char *recoded; void *free_arg; CMD_IRC_SERVER(server); @@ -113,8 +127,11 @@ static void cmd_notice(const char *data, IRC_SERVER_REC *server, if (*target == '\0' || *msg == '\0') cmd_param_error(CMDERR_NOT_ENOUGH_PARAMS); - - signal_emit("message irc own_notice", 3, server, msg, target); + + recoded = recode_out(msg, target); + signal_emit("message irc own_notice", 3, server, recoded, target); + + g_free(recoded); cmd_params_free(free_arg); } -- cgit v1.2.3