diff options
author | Sébastien Helleu <flashcode@flashtux.org> | 2024-02-16 19:22:28 +0100 |
---|---|---|
committer | Sébastien Helleu <flashcode@flashtux.org> | 2024-02-16 19:22:28 +0100 |
commit | 162bcb26223daffb5e231adef47044a2aff628eb (patch) | |
tree | 1b1621f9a64077e4e22742ea4a22e1079b8102fa | |
parent | 8b6452eb918abfe3b3e886e7f6515394052db464 (diff) | |
download | weechat-162bcb26223daffb5e231adef47044a2aff628eb.zip |
irc: don't strip monospace color code 0x11 from incoming messages (closes #2073)
-rw-r--r-- | ChangeLog.adoc | 1 | ||||
-rw-r--r-- | src/plugins/irc/irc-color.c | 3 | ||||
-rw-r--r-- | src/plugins/irc/irc-color.h | 3 | ||||
-rw-r--r-- | tests/unit/plugins/irc/test-irc-color.cpp | 21 |
4 files changed, 11 insertions, 17 deletions
diff --git a/ChangeLog.adoc b/ChangeLog.adoc index fa82984b3..48d51a99c 100644 --- a/ChangeLog.adoc +++ b/ChangeLog.adoc @@ -27,6 +27,7 @@ New features:: Bug fixes:: * core: remove trailing directory separators in home directories (issue #2070) + * irc: don't strip monospace color code 0x11 from incoming messages (issue #2073) * irc: fix random date displayed when a received message contains tags but no "time" (issue #2064) * scripts: fix crash on script unload when a hook is created in a buffer close callback (issue #2067) * trigger: fix memory leak when adding a new trigger with `/trigger` command diff --git a/src/plugins/irc/irc-color.c b/src/plugins/irc/irc-color.c index 07174c373..6ba5561d8 100644 --- a/src/plugins/irc/irc-color.c +++ b/src/plugins/irc/irc-color.c @@ -258,9 +258,6 @@ irc_color_decode (const char *string, int keep_colors) underline = 0; ptr_string++; break; - case IRC_COLOR_FIXED_CHAR: - ptr_string++; - break; case IRC_COLOR_REVERSE_CHAR: if (keep_colors) { diff --git a/src/plugins/irc/irc-color.h b/src/plugins/irc/irc-color.h index be7b6b926..3f6592c61 100644 --- a/src/plugins/irc/irc-color.h +++ b/src/plugins/irc/irc-color.h @@ -50,9 +50,6 @@ #define IRC_COLOR_RESET_CHAR '\x0F' /* reset color/attributes */ #define IRC_COLOR_RESET_STR "\x0F" /* [0F]... */ -#define IRC_COLOR_FIXED_CHAR '\x11' /* monospaced font (ignored) */ -#define IRC_COLOR_FIXED_STR "\x11" /* [11]...[11] */ - #define IRC_COLOR_REVERSE_CHAR '\x16' /* reverse video (fg <--> bg) */ #define IRC_COLOR_REVERSE_STR "\x16" /* [16]...[16] */ diff --git a/tests/unit/plugins/irc/test-irc-color.cpp b/tests/unit/plugins/irc/test-irc-color.cpp index 8a240c94c..cc22555f0 100644 --- a/tests/unit/plugins/irc/test-irc-color.cpp +++ b/tests/unit/plugins/irc/test-irc-color.cpp @@ -41,8 +41,6 @@ extern int irc_color_convert_term2irc (int color); "test_" IRC_COLOR_BOLD_STR "bold" IRC_COLOR_BOLD_STR "_end" #define STRING_IRC_RESET \ "test_" IRC_COLOR_RESET_STR "reset" IRC_COLOR_RESET_STR "_end" -#define STRING_IRC_FIXED \ - "test_" IRC_COLOR_FIXED_STR "fixed" IRC_COLOR_FIXED_STR "_end" #define STRING_IRC_REVERSE \ "test_" IRC_COLOR_REVERSE_STR "reverse" IRC_COLOR_REVERSE_STR "_end" #define STRING_IRC_ITALIC \ @@ -57,11 +55,16 @@ extern int irc_color_convert_term2irc (int color); "test_" IRC_COLOR_COLOR_STR "11,05" "lightcyan/red" \ IRC_COLOR_COLOR_STR "_end" #define STRING_IRC_ONLY_ATTRS_AND_COLORS \ - IRC_COLOR_COLOR_STR IRC_COLOR_RESET_STR \ - IRC_COLOR_BOLD_STR IRC_COLOR_FIXED_STR IRC_COLOR_REVERSE_STR \ - IRC_COLOR_ITALIC_STR IRC_COLOR_UNDERLINE_STR \ - IRC_COLOR_UNDERLINE_STR IRC_COLOR_ITALIC_STR \ - IRC_COLOR_REVERSE_STR IRC_COLOR_FIXED_STR IRC_COLOR_BOLD_STR + IRC_COLOR_COLOR_STR \ + IRC_COLOR_RESET_STR \ + IRC_COLOR_BOLD_STR \ + IRC_COLOR_REVERSE_STR \ + IRC_COLOR_ITALIC_STR \ + IRC_COLOR_UNDERLINE_STR \ + IRC_COLOR_UNDERLINE_STR \ + IRC_COLOR_ITALIC_STR \ + IRC_COLOR_REVERSE_STR \ + IRC_COLOR_BOLD_STR #define STRING_IRC_ATTRS_AND_COLORS \ "test_" \ IRC_COLOR_BOLD_STR IRC_COLOR_UNDERLINE_STR \ @@ -237,10 +240,6 @@ TEST(IrcColor, Decode) gui_color_get_custom ("reset")); WEE_CHECK_DECODE(string, STRING_IRC_RESET, 1); - /* fixed */ - WEE_CHECK_DECODE("test_fixed_end", STRING_IRC_FIXED, 0); - WEE_CHECK_DECODE("test_fixed_end", STRING_IRC_FIXED, 1); - /* reverse */ WEE_CHECK_DECODE("test_reverse_end", STRING_IRC_REVERSE, 0); snprintf (string, sizeof (string), |