diff options
author | Valentin Batz <senneth@irssi.org> | 2005-02-11 17:27:09 +0000 |
---|---|---|
committer | vb <vb@dbcabf3a-b0e7-0310-adc4-f8d773084564> | 2005-02-11 17:27:09 +0000 |
commit | 5a8b583347e49324c59887b6fb309bff4f8a783e (patch) | |
tree | e5860baa7e75010c954b0c6ce2084a6cc00be068 /src | |
parent | 19e800cf236bc8258b9a19a0685dac383f9f82ec (diff) | |
download | irssi-5a8b583347e49324c59887b6fb309bff4f8a783e.zip |
Fixed output of /hilight (add a space after -levels if any).
Added recode to dcc-chat, patch by Jean-Yves Lefort
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@3708 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src')
-rw-r--r-- | src/fe-common/core/hilight-text.c | 2 | ||||
-rw-r--r-- | src/irc/dcc/dcc-chat.c | 25 |
2 files changed, 22 insertions, 5 deletions
diff --git a/src/fe-common/core/hilight-text.c b/src/fe-common/core/hilight-text.c index b379b814..4a913ee6 100644 --- a/src/fe-common/core/hilight-text.c +++ b/src/fe-common/core/hilight-text.c @@ -500,6 +500,8 @@ static void hilight_print(int index, HILIGHT_REC *rec) g_strjoinv(",", rec->channels); levelstr = rec->level == 0 ? NULL : bits2level(rec->level); + if (levelstr != NULL) + levelstr = g_strconcat(levelstr, " ", NULL); printformat(NULL, NULL, MSGLEVEL_CLIENTCRAP, TXT_HILIGHT_LINE, index, rec->text, chans != NULL ? chans : "", diff --git a/src/irc/dcc/dcc-chat.c b/src/irc/dcc/dcc-chat.c index 6281d252..0170e73f 100644 --- a/src/irc/dcc/dcc-chat.c +++ b/src/irc/dcc/dcc-chat.c @@ -21,6 +21,7 @@ #include "module.h" #include "signals.h" #include "commands.h" +#include "recode.h" #include "network.h" #include "net-nonblock.h" #include "net-sendbuffer.h" @@ -147,18 +148,22 @@ void dcc_ctcp_message(IRC_SERVER_REC *server, const char *target, CHAT_DCC_REC *chat, int notice, const char *msg) { char *str; + char *recoded; if (chat != NULL && chat->sendbuf != NULL) { /* send it via open DCC chat */ + recoded = recode_out(SERVER(server), msg, chat->nick); str = g_strdup_printf("%s\001%s\001", chat->mirc_ctcp ? "" : notice ? "CTCP_REPLY " : - "CTCP_MESSAGE ", msg); + "CTCP_MESSAGE ", recoded); dcc_chat_send(chat, str); g_free(str); } else { + recoded = recode_out(SERVER(server), msg, target); irc_send_cmdv(server, "%s %s :\001%s\001", - notice ? "NOTICE" : "PRIVMSG", target, msg); + notice ? "NOTICE" : "PRIVMSG", target, recoded); } + g_free(recoded); } /* If `item' is a query of a =nick, return DCC chat record of nick */ @@ -196,8 +201,13 @@ static void cmd_msg(const char *data, SERVER_REC *server, WI_ITEM_REC *item) else dcc = NULL; - if (dcc != NULL && dcc->sendbuf != NULL) - dcc_chat_send(dcc, text); + if (dcc != NULL && dcc->sendbuf != NULL) { + char *recoded; + + recoded = recode_out(server, text, dcc->nick); + dcc_chat_send(dcc, recoded); + g_free(recoded); + } if (dcc != NULL || *target == '=') signal_stop(); @@ -305,8 +315,13 @@ void dcc_chat_input(CHAT_DCC_REC *dcc) } if (ret > 0) { + char *recoded; + dcc->transfd += ret; - signal_emit("dcc chat message", 2, dcc, str); + + recoded = recode_in(SERVER(dcc->server), str, dcc->nick); + signal_emit("dcc chat message", 2, dcc, recoded); + g_free(recoded); } } while (ret > 0); } |