diff options
author | Sebastien Helleu <flashcode@flashtux.org> | 2005-01-02 02:10:10 +0000 |
---|---|---|
committer | Sebastien Helleu <flashcode@flashtux.org> | 2005-01-02 02:10:10 +0000 |
commit | b2c5317e17f27170a0a831b74c819c671c29ec44 (patch) | |
tree | 823ba13b1e2d8f733be720d67bb235a2a8cdbc5b /src/irc | |
parent | 9adb547b36bc6d0ab40ac558021697a16e29d8fb (diff) | |
download | weechat-b2c5317e17f27170a0a831b74c819c671c29ec44.zip |
Added new options look_charset_decode/look_charset_encode and /unset command.
Diffstat (limited to 'src/irc')
-rw-r--r-- | src/irc/irc-server.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/irc/irc-server.c b/src/irc/irc-server.c index 03c3ba8cf..2a9d184c1 100644 --- a/src/irc/irc-server.c +++ b/src/irc/irc-server.c @@ -39,6 +39,7 @@ #include "../common/weechat.h" #include "irc.h" +#include "../common/weeconfig.h" #include "../gui/gui.h" @@ -369,6 +370,7 @@ server_sendf (t_irc_server * server, char *fmt, ...) { va_list args; static char buffer[1024]; + char *buf2; int size_buf; if (!server) @@ -384,14 +386,16 @@ server_sendf (t_irc_server * server, char *fmt, ...) buffer[sizeof (buffer) - 1] = '\0'; if ((size_buf < 0) || (size_buf > (int) (sizeof (buffer) - 1))) size_buf = strlen (buffer); - buffer[size_buf - 2] = '\0'; #ifdef DEBUG + buffer[size_buf - 2] = '\0'; gui_printf (server->buffer, "[DEBUG] Sending to server >>> %s\n", buffer); - #endif buffer[size_buf - 2] = '\r'; - if (server_send (server, buffer, size_buf) <= 0) + #endif + buf2 = weechat_convert_encoding (local_charset, cfg_look_charset_encode, buffer); + if (server_send (server, buf2, strlen (buf2)) <= 0) gui_printf (server->buffer, _("%s error sending data to IRC server\n"), WEECHAT_ERROR); + free (buf2); } /* |