From 1b27be4abc46d882f05dfe622925444a6b394710 Mon Sep 17 00:00:00 2001 From: Emanuele Giaquinta Date: Sun, 9 Nov 2008 23:53:40 +0000 Subject: [PATCH] Emit message irc own_{action,notice,wall} and message dcc own{,_action} with message in client encoding. git-svn-id: file:///var/www/svn.irssi.org/SVN/irssi/trunk@4891 dbcabf3a-b0e7-0310-adc4-f8d773084564 --- src/fe-common/irc/dcc/fe-dcc-chat-messages.c | 15 ++++---------- src/fe-common/irc/fe-irc-commands.c | 9 +++------ src/fe-common/irc/fe-irc-messages.c | 21 +++++--------------- 3 files changed, 12 insertions(+), 33 deletions(-) diff --git a/src/fe-common/irc/dcc/fe-dcc-chat-messages.c b/src/fe-common/irc/dcc/fe-dcc-chat-messages.c index 6a5acdff..23ccc943 100644 --- a/src/fe-common/irc/dcc/fe-dcc-chat-messages.c +++ b/src/fe-common/irc/dcc/fe-dcc-chat-messages.c @@ -21,7 +21,6 @@ #include "module.h" #include "signals.h" #include "levels.h" -#include "recode.h" #include "irc-servers.h" #include "irc-queries.h" @@ -34,7 +33,7 @@ static void sig_message_dcc_own(CHAT_DCC_REC *dcc, const char *msg) { TEXT_DEST_REC dest; QUERY_REC *query; - char *tag, *recoded; + char *tag; tag = g_strconcat("=", dcc->id, NULL); query = query_find(NULL, tag); @@ -43,11 +42,8 @@ static void sig_message_dcc_own(CHAT_DCC_REC *dcc, const char *msg) MSGLEVEL_DCCMSGS | MSGLEVEL_NOHILIGHT | MSGLEVEL_NO_ACT, NULL); - /* ugly: recode the sent message back for printing */ - recoded = recode_in(SERVER(dcc->server), msg, dcc->target == NULL ? dcc->mynick : dcc->target); printformat_dest(&dest, query != NULL ? IRCTXT_OWN_DCC_QUERY : - IRCTXT_OWN_DCC, dcc->mynick, dcc->id, recoded); - g_free(recoded); + IRCTXT_OWN_DCC, dcc->mynick, dcc->id, msg); g_free(tag); } @@ -55,7 +51,7 @@ static void sig_message_dcc_own_action(CHAT_DCC_REC *dcc, const char *msg) { TEXT_DEST_REC dest; QUERY_REC *query; - char *tag, *recoded; + char *tag; tag = g_strconcat("=", dcc->id, NULL); query = query_find(NULL, tag); @@ -64,11 +60,8 @@ static void sig_message_dcc_own_action(CHAT_DCC_REC *dcc, const char *msg) MSGLEVEL_DCCMSGS | MSGLEVEL_ACTIONS | MSGLEVEL_NOHILIGHT | MSGLEVEL_NO_ACT, NULL); - /* ugly: recode the sent message back for printing */ - recoded = recode_in(SERVER(dcc->server), msg, dcc->target == NULL ? dcc->mynick : dcc->target); printformat_dest(&dest, query != NULL ? IRCTXT_OWN_DCC_ACTION_QUERY : - IRCTXT_OWN_DCC_ACTION, dcc->mynick, dcc->id, recoded); - g_free(recoded); + IRCTXT_OWN_DCC_ACTION, dcc->mynick, dcc->id, msg); g_free(tag); } diff --git a/src/fe-common/irc/fe-irc-commands.c b/src/fe-common/irc/fe-irc-commands.c index 37f8b9ab..78a576f7 100644 --- a/src/fe-common/irc/fe-irc-commands.c +++ b/src/fe-common/irc/fe-irc-commands.c @@ -57,7 +57,7 @@ static void cmd_me(const char *data, IRC_SERVER_REC *server, WI_ITEM_REC *item) target = window_item_get_target(item); recoded = recode_out(SERVER(server), data, target); - signal_emit("message irc own_action", 3, server, recoded, + signal_emit("message irc own_action", 3, server, data, item->visible_name); irc_send_cmdv(server, "PRIVMSG %s :\001ACTION %s\001", @@ -90,7 +90,7 @@ static void cmd_action(const char *data, IRC_SERVER_REC *server) recoded = recode_out(SERVER(server), text, target); irc_send_cmdv(server, "PRIVMSG %s :\001ACTION %s\001", target, recoded); - signal_emit("message irc own_action", 3, server, recoded, target); + signal_emit("message irc own_action", 3, server, text, target); g_free(recoded); cmd_params_free(free_arg); @@ -100,7 +100,6 @@ 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); @@ -114,10 +113,8 @@ static void cmd_notice(const char *data, IRC_SERVER_REC *server, if (*target == '\0' || *msg == '\0') cmd_param_error(CMDERR_NOT_ENOUGH_PARAMS); - recoded = recode_out(SERVER(server), msg, target); - signal_emit("message irc own_notice", 3, server, recoded, target); + signal_emit("message irc own_notice", 3, server, msg, target); - g_free(recoded); cmd_params_free(free_arg); } diff --git a/src/fe-common/irc/fe-irc-messages.c b/src/fe-common/irc/fe-irc-messages.c index c3396951..36194a9b 100644 --- a/src/fe-common/irc/fe-irc-messages.c +++ b/src/fe-common/irc/fe-irc-messages.c @@ -24,7 +24,6 @@ #include "channels.h" #include "ignore.h" #include "settings.h" -#include "recode.h" #include "irc-servers.h" #include "irc-channels.h" @@ -111,21 +110,18 @@ static void sig_message_irc_op_public(SERVER_REC *server, const char *msg, static void sig_message_own_wall(SERVER_REC *server, const char *msg, const char *target) { - char *nickmode, *optarget, *recoded; + char *nickmode, *optarget; nickmode = channel_get_nickmode(channel_find(server, target), server->nick); optarget = g_strconcat("@", target, NULL); - /* ugly: recode the sent message back for printing */ - recoded = recode_in(SERVER(server), msg, target); printformat_module("fe-common/core", server, target, MSGLEVEL_PUBLIC | MSGLEVEL_NOHILIGHT | MSGLEVEL_NO_ACT, TXT_OWN_MSG_CHANNEL, - server->nick, optarget, recoded, nickmode); + server->nick, optarget, msg, nickmode); g_free(nickmode); - g_free(recoded); g_free(optarget); } @@ -134,7 +130,7 @@ static void sig_message_own_action(IRC_SERVER_REC *server, const char *msg, { void *item; const char *oldtarget; - char *freemsg = NULL, *recoded; + char *freemsg = NULL; oldtarget = target; target = skip_target(IRC_SERVER(server), target); @@ -146,15 +142,11 @@ static void sig_message_own_action(IRC_SERVER_REC *server, const char *msg, if (settings_get_bool("emphasis")) msg = freemsg = expand_emphasis(item, msg); - /* ugly: recode the sent message back for printing */ - recoded = recode_in(SERVER(server), msg, target); - printformat(server, target, MSGLEVEL_ACTIONS | MSGLEVEL_NOHILIGHT | MSGLEVEL_NO_ACT | (ischannel(*target) ? MSGLEVEL_PUBLIC : MSGLEVEL_MSGS), item != NULL && oldtarget == target ? IRCTXT_OWN_ACTION : IRCTXT_OWN_ACTION_TARGET, - server->nick, recoded, oldtarget); - g_free(recoded); + server->nick, msg, oldtarget); g_free_not_null(freemsg); } @@ -210,12 +202,9 @@ static void sig_message_irc_action(IRC_SERVER_REC *server, const char *msg, static void sig_message_own_notice(IRC_SERVER_REC *server, const char *msg, const char *target) { - /* ugly: recode the sent message back for printing */ - char *recoded = recode_in(SERVER(server), msg, target); printformat(server, skip_target(server, target), MSGLEVEL_NOTICES | MSGLEVEL_NOHILIGHT | MSGLEVEL_NO_ACT, - IRCTXT_OWN_NOTICE, target, recoded); - g_free(recoded); + IRCTXT_OWN_NOTICE, target, msg); } static void sig_message_irc_notice(SERVER_REC *server, const char *msg,