summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastien Helleu <flashcode@flashtux.org>2005-12-18 00:22:51 +0000
committerSebastien Helleu <flashcode@flashtux.org>2005-12-18 00:22:51 +0000
commit77b504cd3f2e8940e6a45c99e7654cad12185e8e (patch)
tree1aa16053d50e0c2f0b955a0a4634d2f67a575c03
parent04fda8a3147b78213f79f53ccdff93c6f6959a3d (diff)
downloadweechat-77b504cd3f2e8940e6a45c99e7654cad12185e8e.zip
Fixed encoding bug ("encode" var was not used since new command /charset was introduced)
-rw-r--r--src/common/command.c15
-rw-r--r--weechat/src/common/command.c15
2 files changed, 22 insertions, 8 deletions
diff --git a/src/common/command.c b/src/common/command.c
index cc7c3469a..1eaa7f641 100644
--- a/src/common/command.c
+++ b/src/common/command.c
@@ -746,7 +746,8 @@ user_command (t_gui_buffer *buffer, t_irc_server *server, char *command)
t_gui_window *ptr_window;
t_irc_nick *ptr_nick;
int plugin_args_length;
- char *command_with_colors, *command_with_colors2, *plugin_args;
+ char *command_with_colors, *command_encoded, *command_with_colors2;
+ char *plugin_args;
if ((!command) || (!command[0]) || (command[0] == '\r') || (command[0] == '\n'))
return;
@@ -778,15 +779,19 @@ user_command (t_gui_buffer *buffer, t_irc_server *server, char *command)
command_with_colors = (cfg_irc_colors_send) ?
(char *)gui_color_encode ((unsigned char *)command) : NULL;
+ command_encoded = channel_iconv_encode (SERVER(buffer),
+ CHANNEL(buffer),
+ (command_with_colors) ? command_with_colors: command);
if (CHANNEL(buffer)->dcc_chat)
dcc_chat_sendf ((t_irc_dcc *)(CHANNEL(buffer)->dcc_chat),
"%s\r\n",
- (command_with_colors) ? command_with_colors : command);
+ (command_encoded) ? command_encoded :
+ ((command_with_colors) ? command_with_colors : command));
else
server_sendf (server, "PRIVMSG %s :%s\r\n",
CHANNEL(buffer)->name,
- (command_with_colors) ?
- command_with_colors : command);
+ (command_encoded) ? command_encoded :
+ ((command_with_colors) ? command_with_colors : command));
command_with_colors2 = (command_with_colors) ?
(char *)gui_color_decode ((unsigned char *)command_with_colors, 1) : NULL;
@@ -832,6 +837,8 @@ user_command (t_gui_buffer *buffer, t_irc_server *server, char *command)
free (command_with_colors);
if (command_with_colors2)
free (command_with_colors2);
+ if (command_encoded)
+ free (command_encoded);
/* sending a copy of the message as PRIVMSG to plugins because irc server doesn't */
diff --git a/weechat/src/common/command.c b/weechat/src/common/command.c
index cc7c3469a..1eaa7f641 100644
--- a/weechat/src/common/command.c
+++ b/weechat/src/common/command.c
@@ -746,7 +746,8 @@ user_command (t_gui_buffer *buffer, t_irc_server *server, char *command)
t_gui_window *ptr_window;
t_irc_nick *ptr_nick;
int plugin_args_length;
- char *command_with_colors, *command_with_colors2, *plugin_args;
+ char *command_with_colors, *command_encoded, *command_with_colors2;
+ char *plugin_args;
if ((!command) || (!command[0]) || (command[0] == '\r') || (command[0] == '\n'))
return;
@@ -778,15 +779,19 @@ user_command (t_gui_buffer *buffer, t_irc_server *server, char *command)
command_with_colors = (cfg_irc_colors_send) ?
(char *)gui_color_encode ((unsigned char *)command) : NULL;
+ command_encoded = channel_iconv_encode (SERVER(buffer),
+ CHANNEL(buffer),
+ (command_with_colors) ? command_with_colors: command);
if (CHANNEL(buffer)->dcc_chat)
dcc_chat_sendf ((t_irc_dcc *)(CHANNEL(buffer)->dcc_chat),
"%s\r\n",
- (command_with_colors) ? command_with_colors : command);
+ (command_encoded) ? command_encoded :
+ ((command_with_colors) ? command_with_colors : command));
else
server_sendf (server, "PRIVMSG %s :%s\r\n",
CHANNEL(buffer)->name,
- (command_with_colors) ?
- command_with_colors : command);
+ (command_encoded) ? command_encoded :
+ ((command_with_colors) ? command_with_colors : command));
command_with_colors2 = (command_with_colors) ?
(char *)gui_color_decode ((unsigned char *)command_with_colors, 1) : NULL;
@@ -832,6 +837,8 @@ user_command (t_gui_buffer *buffer, t_irc_server *server, char *command)
free (command_with_colors);
if (command_with_colors2)
free (command_with_colors2);
+ if (command_encoded)
+ free (command_encoded);
/* sending a copy of the message as PRIVMSG to plugins because irc server doesn't */