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/irc/dcc | |
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/irc/dcc')
-rw-r--r-- | src/fe-common/irc/dcc/fe-dcc-chat-messages.c | 20 |
1 files changed, 14 insertions, 6 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 65ab9a56..d1eaa642 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,9 @@ #include "module.h" #include "signals.h" #include "levels.h" +#include "recode.h" +#include "irc-servers.h" #include "irc-queries.h" #include "dcc-chat.h" @@ -32,7 +34,7 @@ static void sig_message_dcc_own(CHAT_DCC_REC *dcc, const char *msg) { TEXT_DEST_REC dest; QUERY_REC *query; - char *tag; + char *tag, *recoded; tag = g_strconcat("=", dcc->id, NULL); query = query_find(NULL, tag); @@ -41,8 +43,11 @@ 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 printin */ + 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, msg); + IRCTXT_OWN_DCC, dcc->mynick, dcc->id, recoded); + g_free(recoded); g_free(tag); } @@ -50,7 +55,7 @@ static void sig_message_dcc_own_action(CHAT_DCC_REC *dcc, const char *msg) { TEXT_DEST_REC dest; QUERY_REC *query; - char *tag; + char *tag, *recoded; tag = g_strconcat("=", dcc->id, NULL); query = query_find(NULL, tag); @@ -58,9 +63,12 @@ static void sig_message_dcc_own_action(CHAT_DCC_REC *dcc, const char *msg) format_create_dest_tag(&dest, dcc->server, dcc->servertag, tag, MSGLEVEL_DCCMSGS | MSGLEVEL_ACTIONS | MSGLEVEL_NOHILIGHT | MSGLEVEL_NO_ACT, NULL); - - printformat_dest(&dest, query != NULL ? IRCTXT_OWN_DCC_ACTION_QUERY : - IRCTXT_OWN_DCC_ACTION, dcc->mynick, dcc->id, msg); + + /* 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); g_free(tag); } |