1
0
mirror of https://github.com/weechat/weechat.git synced 2026-07-09 03:03:12 +02:00

irc: decode IRC color codes only when displaying messages

Before parsing IRC messages, they were almost all changed to convert IRC color
codes to WeeChat color codes, which caused some bugs when storing data like
account and real names (stored with WeeChat color codes instead of IRC colors).

Now the messages are parsed as-is, then the colors are converted only when
strings are displayed in a buffer by `weechat_printf()`.
This commit is contained in:
Sébastien Helleu
2024-09-19 08:35:56 +02:00
parent 02847246b2
commit 6534919868
10 changed files with 885 additions and 855 deletions
+4 -4
View File
@@ -193,7 +193,7 @@ irc_input_user_message_display (struct t_irc_server *server,
server->nick,
(ptr_text && ptr_text[0]) ? IRC_COLOR_RESET : "",
(ptr_text && ptr_text[0]) ? " " : "",
(ptr_text && ptr_text[0]) ? ptr_text : "");
IRC_COLOR_MSG(ptr_text));
}
else
{
@@ -209,7 +209,7 @@ irc_input_user_message_display (struct t_irc_server *server,
server->nick,
IRC_COLOR_RESET,
(ptr_text && ptr_text[0]) ? " " : "",
(ptr_text && ptr_text[0]) ? ptr_text : "");
IRC_COLOR_MSG(ptr_text));
}
}
else if (ctcp_type)
@@ -229,7 +229,7 @@ irc_input_user_message_display (struct t_irc_server *server,
ctcp_type,
IRC_COLOR_RESET,
(ptr_text && ptr_text[0]) ? " " : "",
(ptr_text && ptr_text[0]) ? ptr_text : "");
IRC_COLOR_MSG(ptr_text));
}
else if (display_target)
{
@@ -256,7 +256,7 @@ irc_input_user_message_display (struct t_irc_server *server,
IRC_COLOR_CHAT_CHANNEL : irc_nick_color_for_msg (server, 0, NULL, target),
target,
IRC_COLOR_RESET,
(ptr_text) ? ptr_text : "");
IRC_COLOR_MSG(ptr_text));
}
else
{