summaryrefslogtreecommitdiff
path: root/src/fe-common/irc/fe-irc-messages.c
diff options
context:
space:
mode:
authorEmanuele Giaquinta <exg@irssi.org>2008-08-02 13:15:38 +0000
committerexg <exg@dbcabf3a-b0e7-0310-adc4-f8d773084564>2008-08-02 13:15:38 +0000
commit9fa8cbe7a2ac1c17fa4494389b199319ec966aae (patch)
treed87ae801571f4a7dc7ad05f7f80df4286bc2ed7d /src/fe-common/irc/fe-irc-messages.c
parentd788673eb92d68d796f69e70ab2dddeb01778585 (diff)
downloadirssi-9fa8cbe7a2ac1c17fa4494389b199319ec966aae.zip
Revert recode changes r4483 and r4715.
git-svn-id: file:///var/www/svn.irssi.org/SVN/irssi/trunk@4867 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src/fe-common/irc/fe-irc-messages.c')
-rw-r--r--src/fe-common/irc/fe-irc-messages.c49
1 files changed, 35 insertions, 14 deletions
diff --git a/src/fe-common/irc/fe-irc-messages.c b/src/fe-common/irc/fe-irc-messages.c
index 36194a9b..06159582 100644
--- a/src/fe-common/irc/fe-irc-messages.c
+++ b/src/fe-common/irc/fe-irc-messages.c
@@ -24,6 +24,7 @@
#include "channels.h"
#include "ignore.h"
#include "settings.h"
+#include "recode.h"
#include "irc-servers.h"
#include "irc-channels.h"
@@ -67,7 +68,7 @@ static void sig_message_own_public(SERVER_REC *server, const char *msg,
const char *target, const char *origtarget)
{
const char *oldtarget;
- char *nickmode;
+ char *nickmode, *recoded;
oldtarget = target;
target = skip_target(IRC_SERVER(server), target);
@@ -77,12 +78,15 @@ 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, msg, nickmode);
+ server->nick, oldtarget, recoded, nickmode);
g_free(nickmode);
+ g_free(recoded);
signal_stop();
}
@@ -110,18 +114,21 @@ 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;
+ char *nickmode, *optarget, *recoded;
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, msg, nickmode);
+ server->nick, optarget, recoded, nickmode);
g_free(nickmode);
+ g_free(recoded);
g_free(optarget);
}
@@ -130,7 +137,7 @@ static void sig_message_own_action(IRC_SERVER_REC *server, const char *msg,
{
void *item;
const char *oldtarget;
- char *freemsg = NULL;
+ char *freemsg = NULL, *recoded;
oldtarget = target;
target = skip_target(IRC_SERVER(server), target);
@@ -142,11 +149,15 @@ 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, msg, oldtarget);
+ server->nick, recoded, oldtarget);
+ g_free(recoded);
g_free_not_null(freemsg);
}
@@ -156,7 +167,7 @@ static void sig_message_irc_action(IRC_SERVER_REC *server, const char *msg,
{
void *item;
const char *oldtarget;
- char *freemsg = NULL;
+ char *freemsg = NULL, *recoded;
int level;
oldtarget = target;
@@ -176,35 +187,40 @@ static void sig_message_irc_action(IRC_SERVER_REC *server, const char *msg,
if (settings_get_bool("emphasis"))
msg = freemsg = expand_emphasis(item, msg);
+ recoded = recode_in(SERVER(server), msg, target);
if (ischannel(*target)) {
/* channel action */
if (window_item_is_active(item) && target == oldtarget) {
/* message to active channel in window */
printformat(server, target, level,
- IRCTXT_ACTION_PUBLIC, nick, msg);
+ IRCTXT_ACTION_PUBLIC, nick, recoded);
} else {
/* message to not existing/active channel, or to @/+ */
printformat(server, target, level,
IRCTXT_ACTION_PUBLIC_CHANNEL,
- nick, oldtarget, msg);
+ nick, oldtarget, recoded);
}
} else {
/* private action */
printformat(server, nick, MSGLEVEL_ACTIONS | MSGLEVEL_MSGS,
item == NULL ? IRCTXT_ACTION_PRIVATE :
IRCTXT_ACTION_PRIVATE_QUERY,
- nick, address == NULL ? "" : address, msg);
+ nick, address == NULL ? "" : address, recoded);
}
+ g_free(recoded);
g_free_not_null(freemsg);
}
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, msg);
+ IRCTXT_OWN_NOTICE, target, recoded);
+ g_free(recoded);
}
static void sig_message_irc_notice(SERVER_REC *server, const char *msg,
@@ -212,17 +228,20 @@ static void sig_message_irc_notice(SERVER_REC *server, const char *msg,
const char *target)
{
const char *oldtarget;
+ char *recoded;
oldtarget = target;
target = skip_target(IRC_SERVER(server), target);
if (address == NULL || *address == '\0') {
/* notice from server */
+ recoded = recode_in(SERVER(server), msg, NULL);
if (!ignore_check(server, nick, "",
target, msg, MSGLEVEL_SNOTES)) {
printformat(server, target, MSGLEVEL_SNOTES,
- IRCTXT_NOTICE_SERVER, nick, msg);
+ IRCTXT_NOTICE_SERVER, nick, recoded);
}
+ g_free(recoded);
return;
}
@@ -231,17 +250,19 @@ static void sig_message_irc_notice(SERVER_REC *server, const char *msg,
msg, MSGLEVEL_NOTICES))
return;
+ recoded = recode_in(SERVER(server), msg, target);
if (ischannel(*target)) {
/* notice in some channel */
printformat(server, target, MSGLEVEL_NOTICES,
- IRCTXT_NOTICE_PUBLIC, nick, oldtarget, msg);
+ IRCTXT_NOTICE_PUBLIC, nick, oldtarget, recoded);
} else {
/* private notice */
privmsg_get_query(SERVER(server), nick, FALSE,
MSGLEVEL_NOTICES);
printformat(server, nick, MSGLEVEL_NOTICES,
- IRCTXT_NOTICE_PRIVATE, nick, address, msg);
+ IRCTXT_NOTICE_PRIVATE, nick, address, recoded);
}
+ g_free(recoded);
}
static void sig_message_own_ctcp(IRC_SERVER_REC *server, const char *cmd,