irc: fix double decoding of IRC colors in messages sent/displayed by commands /msg and /query (issue #943)

v2.8-utf8proc
Sébastien Helleu 2017-04-07 22:28:48 +02:00
parent fab7a8bdfd
commit a4dffb1915
2 changed files with 19 additions and 33 deletions

View File

@ -42,6 +42,7 @@ Improvements::
Bug fixes::
* core: fix delayed refresh when the signal SIGWINCH is received (terminal resized), send signal "signal_sigwinch" after refreshes (issue #902)
* irc: fix double decoding of IRC colors in messages sent/displayed by commands /msg and /query (issue #943)
* irc: fix parsing of message 324 (modes) when there is a colon before the modes (issue #913)
* relay: check buffer pointer received in "sync" and "desync" commands (weechat protocol) (issue #936)
* relay: remove buffer from synchronized buffers when it is closed (fix memory leak)

View File

@ -3243,15 +3243,8 @@ IRC_COMMAND_CALLBACK(msg)
}
else
{
string = irc_color_decode (
argv_eol[arg_text],
weechat_config_boolean (irc_config_network_colors_send));
irc_input_user_message_display (
ptr_channel->buffer, 0,
(string) ? string : argv_eol[arg_text]);
if (string)
free (string);
irc_input_user_message_display (ptr_channel->buffer, 0,
argv_eol[arg_text]);
irc_server_sendf (ptr_server,
IRC_SERVER_SEND_OUTQ_PRIO_HIGH, NULL,
"PRIVMSG %s :%s",
@ -3281,15 +3274,15 @@ IRC_COMMAND_CALLBACK(msg)
{
if (ptr_channel2)
{
string = irc_color_decode (
argv_eol[arg_text],
weechat_config_boolean (irc_config_network_colors_send));
if (status_msg)
{
/*
* message to channel ops/voiced
* (to "@#channel" or "+#channel")
*/
string = irc_color_decode (
argv_eol[arg_text],
weechat_config_boolean (irc_config_network_colors_send));
weechat_printf_date_tags (
ptr_channel2->buffer,
0,
@ -3302,17 +3295,15 @@ IRC_COMMAND_CALLBACK(msg)
targets[i],
IRC_COLOR_RESET,
(string) ? string : argv_eol[arg_text]);
if (string)
free (string);
}
else
{
/* standard message (to "#channel") */
irc_input_user_message_display (
ptr_channel2->buffer,
0,
(string) ? string : argv_eol[arg_text]);
irc_input_user_message_display (ptr_channel2->buffer,
0, argv_eol[arg_text]);
}
if (string)
free (string);
}
irc_server_sendf (ptr_server,
IRC_SERVER_SEND_OUTQ_PRIO_HIGH, NULL,
@ -3365,20 +3356,18 @@ IRC_COMMAND_CALLBACK(msg)
}
else
{
string = irc_color_decode (
argv_eol[arg_text],
weechat_config_boolean (irc_config_network_colors_send));
ptr_channel2 = irc_channel_search (ptr_server,
targets[i]);
if (ptr_channel2)
{
irc_input_user_message_display (
ptr_channel2->buffer,
0,
(string) ? string : argv_eol[arg_text]);
irc_input_user_message_display (ptr_channel2->buffer,
0, argv_eol[arg_text]);
}
else
{
string = irc_color_decode (
argv_eol[arg_text],
weechat_config_boolean (irc_config_network_colors_send));
weechat_printf_date_tags (
ptr_server->buffer,
0,
@ -3395,9 +3384,9 @@ IRC_COMMAND_CALLBACK(msg)
IRC_COLOR_CHAT_DELIMITERS,
IRC_COLOR_RESET,
(string) ? string : argv_eol[arg_text]);
if (string)
free (string);
}
if (string)
free (string);
}
irc_server_sendf (ptr_server,
IRC_SERVER_SEND_OUTQ_PRIO_HIGH, NULL,
@ -3982,7 +3971,7 @@ IRC_COMMAND_CALLBACK(pong)
IRC_COMMAND_CALLBACK(query)
{
char *string, **nicks;
char **nicks;
int i, arg_nick, arg_text, num_nicks, noswitch;
IRC_BUFFER_GET_SERVER_CHANNEL(buffer);
@ -4074,12 +4063,8 @@ IRC_COMMAND_CALLBACK(query)
/* display text if given */
if (argv_eol[arg_text])
{
string = irc_color_decode (argv_eol[arg_text],
weechat_config_boolean (irc_config_network_colors_send));
irc_input_user_message_display (ptr_channel->buffer, 0,
(string) ? string : argv_eol[arg_text]);
if (string)
free (string);
argv_eol[arg_text]);
irc_server_sendf (ptr_server, IRC_SERVER_SEND_OUTQ_PRIO_HIGH,
NULL,
"PRIVMSG %s :%s",