diff options
author | Sebastien Helleu <flashcode@flashtux.org> | 2006-11-08 07:54:33 +0000 |
---|---|---|
committer | Sebastien Helleu <flashcode@flashtux.org> | 2006-11-08 07:54:33 +0000 |
commit | c20ce83d20526e24601c6c8acabc7a61ab3c3a78 (patch) | |
tree | a8e1b79498ef7cd410176680d9bfb585270aa576 /src/irc/irc-dcc.c | |
parent | b5a7d8e99e372378cb47069a3d2ad0bf65ccc530 (diff) | |
download | weechat-c20ce83d20526e24601c6c8acabc7a61ab3c3a78.zip |
Added charset plugin (WeeChat is now full UTF-8 for internal data storage), fixed compilation problems with FreeBSD, fixed status bar display bug
Diffstat (limited to 'src/irc/irc-dcc.c')
-rw-r--r-- | src/irc/irc-dcc.c | 21 |
1 files changed, 5 insertions, 16 deletions
diff --git a/src/irc/irc-dcc.c b/src/irc/irc-dcc.c index 27ff501a4..be2e593e8 100644 --- a/src/irc/irc-dcc.c +++ b/src/irc/irc-dcc.c @@ -1196,9 +1196,8 @@ dcc_chat_sendf (t_irc_dcc *ptr_dcc, char *fmt, ...) { va_list args; static char buffer[4096]; - char *buf2; int size_buf; - + if (!ptr_dcc || (ptr_dcc->sock < 0)) return; @@ -1217,10 +1216,7 @@ dcc_chat_sendf (t_irc_dcc *ptr_dcc, char *fmt, ...) gui_printf (ptr_dcc->server->buffer, "[DEBUG] Sending to remote host (DCC CHAT) >>> %s\n", buffer); buffer[size_buf - 2] = '\r'; #endif - buf2 = channel_iconv_encode (ptr_dcc->server, - ptr_dcc->channel, - buffer); - if (dcc_chat_send (ptr_dcc, buf2, strlen (buf2)) <= 0) + if (dcc_chat_send (ptr_dcc, buffer, strlen (buffer)) <= 0) { irc_display_prefix (ptr_dcc->server, ptr_dcc->server->buffer, PREFIX_ERROR); @@ -1229,7 +1225,6 @@ dcc_chat_sendf (t_irc_dcc *ptr_dcc, char *fmt, ...) WEECHAT_ERROR, ptr_dcc->nick); dcc_close (ptr_dcc, DCC_FAILED); } - free (buf2); } /* @@ -1242,7 +1237,7 @@ dcc_chat_recv (t_irc_dcc *ptr_dcc) fd_set read_fd; static struct timeval timeout; static char buffer[4096 + 2]; - char *buf2, *pos, *ptr_buf, *ptr_buf2, *next_ptr_buf; + char *buf2, *pos, *ptr_buf, *next_ptr_buf; char *ptr_buf_color; int num_read; @@ -1307,11 +1302,7 @@ dcc_chat_recv (t_irc_dcc *ptr_dcc) if (ptr_buf) { - ptr_buf2 = channel_iconv_decode (ptr_dcc->server, - ptr_dcc->channel, - ptr_buf); - ptr_buf_color = (char *)gui_color_decode ((ptr_buf2) ? - (unsigned char *)ptr_buf2 : (unsigned char *)ptr_buf, + ptr_buf_color = (char *)gui_color_decode ((unsigned char *)ptr_buf, cfg_irc_colors_receive); if (irc_is_highlight (ptr_buf, ptr_dcc->server->nick)) @@ -1326,7 +1317,7 @@ dcc_chat_recv (t_irc_dcc *ptr_dcc) COLOR_WIN_INFOBAR_HIGHLIGHT, _("Private %s> %s"), ptr_dcc->nick, - (ptr_buf_color) ? ptr_buf_color : ((ptr_buf2) ? ptr_buf2 : ptr_buf)); + (ptr_buf_color) ? ptr_buf_color : ptr_buf); } } else @@ -1338,8 +1329,6 @@ dcc_chat_recv (t_irc_dcc *ptr_dcc) (ptr_buf_color) ? ptr_buf_color : ptr_buf); if (ptr_buf_color) free (ptr_buf_color); - if (ptr_buf2) - free (ptr_buf2); } ptr_buf = next_ptr_buf; |