diff options
author | Emanuele Giaquinta <exg@irssi.org> | 2008-02-16 23:28:53 +0000 |
---|---|---|
committer | exg <exg@dbcabf3a-b0e7-0310-adc4-f8d773084564> | 2008-02-16 23:28:53 +0000 |
commit | 0eb386ecd88140863c6377ef18764844103b68d9 (patch) | |
tree | ca109e2b94b304495408e6bacdbe189ec3289f9f /src/fe-common | |
parent | a0400dc3d23c01655b15a4486f8bd5b3c97b75cc (diff) | |
download | irssi-0eb386ecd88140863c6377ef18764844103b68d9.zip |
Move output recoding in irc_send_cmd_full.
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@4715 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src/fe-common')
-rw-r--r-- | src/fe-common/core/fe-common-core.c | 1 | ||||
-rw-r--r-- | src/fe-common/core/fe-messages.c | 20 | ||||
-rw-r--r-- | src/fe-common/irc/fe-irc-commands.c | 21 | ||||
-rw-r--r-- | src/fe-common/irc/fe-irc-messages.c | 28 |
4 files changed, 17 insertions, 53 deletions
diff --git a/src/fe-common/core/fe-common-core.c b/src/fe-common/core/fe-common-core.c index fc52950a..a8076158 100644 --- a/src/fe-common/core/fe-common-core.c +++ b/src/fe-common/core/fe-common-core.c @@ -31,7 +31,6 @@ #include "servers.h" #include "channels.h" #include "servers-setup.h" -#include "recode.h" #include "autorun.h" #include "fe-core-commands.h" diff --git a/src/fe-common/core/fe-messages.c b/src/fe-common/core/fe-messages.c index d9f77e28..e1c0e57a 100644 --- a/src/fe-common/core/fe-messages.c +++ b/src/fe-common/core/fe-messages.c @@ -31,7 +31,6 @@ #include "channels.h" #include "nicklist.h" #include "ignore.h" -#include "recode.h" #include "window-items.h" #include "fe-queries.h" @@ -259,7 +258,7 @@ static void sig_message_own_public(SERVER_REC *server, const char *msg, WINDOW_REC *window; CHANNEL_REC *channel; const char *nickmode; - char *freemsg = NULL, *recoded; + char *freemsg = NULL; int print_channel; channel = channel_find(server, target); if (channel != NULL) @@ -280,18 +279,14 @@ static void sig_message_own_public(SERVER_REC *server, const char *msg, if (settings_get_bool("emphasis")) msg = freemsg = expand_emphasis((WI_ITEM_REC *) channel, msg); - /* ugly: recode the sent message back for printing */ - recoded = recode_in(server, msg, target); - if (!print_channel) { printformat(server, target, MSGLEVEL_PUBLIC | MSGLEVEL_NOHILIGHT | MSGLEVEL_NO_ACT, - TXT_OWN_MSG, server->nick, recoded, nickmode); + TXT_OWN_MSG, server->nick, msg, nickmode); } else { printformat(server, target, MSGLEVEL_PUBLIC | MSGLEVEL_NOHILIGHT | MSGLEVEL_NO_ACT, - TXT_OWN_MSG_CHANNEL, server->nick, target, recoded, nickmode); + TXT_OWN_MSG_CHANNEL, server->nick, target, msg, nickmode); } - g_free(recoded); g_free_not_null(freemsg); } @@ -299,7 +294,7 @@ static void sig_message_own_private(SERVER_REC *server, const char *msg, const char *target, const char *origtarget) { QUERY_REC *query; - char *freemsg = NULL, *recoded; + char *freemsg = NULL; g_return_if_fail(server != NULL); g_return_if_fail(msg != NULL); @@ -322,15 +317,11 @@ static void sig_message_own_private(SERVER_REC *server, const char *msg, if (settings_get_bool("emphasis")) msg = freemsg = expand_emphasis((WI_ITEM_REC *) query, msg); - /* ugly: recode the sent message back for printing */ - recoded = recode_in(server, msg, target); - printformat(server, target, MSGLEVEL_MSGS | MSGLEVEL_NOHILIGHT | MSGLEVEL_NO_ACT, query == NULL ? TXT_OWN_MSG_PRIVATE : - TXT_OWN_MSG_PRIVATE_QUERY, target, recoded, server->nick); + TXT_OWN_MSG_PRIVATE_QUERY, target, msg, server->nick); - g_free(recoded); g_free_not_null(freemsg); } @@ -411,7 +402,6 @@ static void sig_message_quit(SERVER_REC *server, const char *nick, if (once || count == 0) { if (chans->len > 0) g_string_truncate(chans, chans->len-1); - /* at least recode_fallback will be used */ printformat(server, print_channel, MSGLEVEL_QUITS, count <= 1 ? TXT_QUIT : TXT_QUIT_ONCE, nick, address, reason, chans->str); diff --git a/src/fe-common/irc/fe-irc-commands.c b/src/fe-common/irc/fe-irc-commands.c index 37f8b9ab..54c5263f 100644 --- a/src/fe-common/irc/fe-irc-commands.c +++ b/src/fe-common/irc/fe-irc-commands.c @@ -22,7 +22,6 @@ #include "module-formats.h" #include "signals.h" #include "misc.h" -#include "recode.h" #include "special-vars.h" #include "settings.h" @@ -45,7 +44,6 @@ 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)) @@ -55,15 +53,12 @@ static void cmd_me(const char *data, IRC_SERVER_REC *server, WI_ITEM_REC *item) cmd_return_error(CMDERR_NOT_CONNECTED); 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", - target, recoded); - - g_free(recoded); + target, data); } /* SYNTAX: ACTION [-<server tag>] <target> <message> */ @@ -71,7 +66,6 @@ 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); @@ -87,12 +81,10 @@ static void cmd_action(const char *data, IRC_SERVER_REC *server) if (server == NULL || !server->connected) cmd_param_error(CMDERR_NOT_CONNECTED); - recoded = recode_out(SERVER(server), text, target); - irc_send_cmdv(server, "PRIVMSG %s :\001ACTION %s\001", target, recoded); + irc_send_cmdv(server, "PRIVMSG %s :\001ACTION %s\001", target, text); - 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 +92,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 +105,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 4b2301c3..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" @@ -68,7 +67,7 @@ static void sig_message_own_public(SERVER_REC *server, const char *msg, const char *target, const char *origtarget) { const char *oldtarget; - char *nickmode, *recoded; + char *nickmode; oldtarget = target; target = skip_target(IRC_SERVER(server), target); @@ -78,15 +77,12 @@ static void sig_message_own_public(SERVER_REC *server, const char *msg, nickmode = channel_get_nickmode(channel_find(server, target), server->nick); - /* 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, oldtarget, recoded, nickmode); + server->nick, oldtarget, msg, nickmode); g_free(nickmode); - g_free(recoded); signal_stop(); } @@ -114,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); } @@ -137,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); @@ -149,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); } @@ -213,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, |