diff options
author | Valentin Batz <senneth@irssi.org> | 2005-10-10 18:32:32 +0000 |
---|---|---|
committer | vb <vb@dbcabf3a-b0e7-0310-adc4-f8d773084564> | 2005-10-10 18:32:32 +0000 |
commit | fd476e8b319dc7a1d4271ec339df9deb752dc055 (patch) | |
tree | 8109bfada50669eec00874a832eaf21e5e2637e3 /src/fe-common/core/fe-messages.c | |
parent | c701330433d9c85dbf7f2078d56a8529c904e1b5 (diff) | |
download | irssi-fd476e8b319dc7a1d4271ec339df9deb752dc055.zip |
Make the compiler happy by replacing 'const char *' by 'char *'.
Pass the pointer to the SERVER_REC to dcc_ctcp_message.
Recode 'own' messages back for printing just before they actually get printed. (ugly but more effective than adding all the signals in fe-recode and doing it there)
Replaced SERVER_REC by IRC_SERVER_REC in dcc-chat.c since it's belongs to IRC(makes the compiler happy again).
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@4034 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src/fe-common/core/fe-messages.c')
-rw-r--r-- | src/fe-common/core/fe-messages.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/src/fe-common/core/fe-messages.c b/src/fe-common/core/fe-messages.c index aa1ead32..b91f2cf4 100644 --- a/src/fe-common/core/fe-messages.c +++ b/src/fe-common/core/fe-messages.c @@ -257,9 +257,10 @@ static void sig_message_own_public(SERVER_REC *server, const char *msg, WINDOW_REC *window; CHANNEL_REC *channel; const char *nickmode; - char *freemsg = NULL; + char *freemsg = NULL, *recoded; int print_channel; - + /* ugly: recode the sent message back for printing */ + recoded = recode_in(server, msg, target); channel = channel_find(server, target); if (channel != NULL) target = channel->visible_name; @@ -281,12 +282,13 @@ static void sig_message_own_public(SERVER_REC *server, const char *msg, if (!print_channel) { printformat(server, target, MSGLEVEL_PUBLIC | MSGLEVEL_NOHILIGHT | MSGLEVEL_NO_ACT, - TXT_OWN_MSG, server->nick, msg, nickmode); + TXT_OWN_MSG, server->nick, recoded, nickmode); } else { printformat(server, target, MSGLEVEL_PUBLIC | MSGLEVEL_NOHILIGHT | MSGLEVEL_NO_ACT, - TXT_OWN_MSG_CHANNEL, server->nick, target, msg, nickmode); + TXT_OWN_MSG_CHANNEL, server->nick, target, recoded, nickmode); } + g_free(recoded); g_free_not_null(freemsg); } @@ -294,11 +296,10 @@ static void sig_message_own_private(SERVER_REC *server, const char *msg, const char *target, const char *origtarget) { QUERY_REC *query; - char *freemsg = NULL; + char *freemsg = NULL, *recoded; g_return_if_fail(server != NULL); g_return_if_fail(msg != NULL); - if (target == NULL) { /* this should only happen if some special target failed and we should display some error message. currently the special @@ -315,14 +316,17 @@ static void sig_message_own_private(SERVER_REC *server, const char *msg, query = privmsg_get_query(server, target, TRUE, MSGLEVEL_MSGS); + /* ugly: recode the sent message back for printing */ + recoded = recode_in(server, msg, target); if (settings_get_bool("emphasis")) - msg = freemsg = expand_emphasis((WI_ITEM_REC *) query, msg); + msg = freemsg = expand_emphasis((WI_ITEM_REC *) query, recoded); printformat(server, target, MSGLEVEL_MSGS | MSGLEVEL_NOHILIGHT | MSGLEVEL_NO_ACT, query == NULL ? TXT_OWN_MSG_PRIVATE : TXT_OWN_MSG_PRIVATE_QUERY, target, msg, server->nick); + g_free(recoded); g_free_not_null(freemsg); } |