From 9be4bc07b98f96f49654ac34f60dead862e6e675 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Helleu?= Date: Tue, 11 Nov 2014 09:37:10 +0100 Subject: [PATCH] irc: add support for color codes 16-99 in IRC messages (closes #228) (patch from Nei) --- ChangeLog.asciidoc | 1 + src/plugins/irc/irc-color.c | 44 +++++++++++++++++++++++-------------- src/plugins/irc/irc-color.h | 2 +- 3 files changed, 30 insertions(+), 17 deletions(-) diff --git a/ChangeLog.asciidoc b/ChangeLog.asciidoc index 759fab09200..e37a650e42e 100644 --- a/ChangeLog.asciidoc +++ b/ChangeLog.asciidoc @@ -30,6 +30,7 @@ http://weechat.org/files/releasenotes/ReleaseNotes-devel.html[release notes] * api: add regex replace feature in function string_eval_expression * api: use microseconds instead of milliseconds in functions util_timeval_diff and util_timeval_add +* irc: add support for color codes 16-99 in IRC messages (closes #228) * irc: disable SSLv3 by default in server option "ssl_priorities" (closes #248) * irc: add support of "extended-join" capability (closes #143, closes #212) * irc: automatically add current channel in command /samode (closes #241) diff --git a/src/plugins/irc/irc-color.c b/src/plugins/irc/irc-color.c index 6c0713aec19..63cac5b7391 100644 --- a/src/plugins/irc/irc-color.c +++ b/src/plugins/irc/irc-color.c @@ -32,22 +32,34 @@ char *irc_color_to_weechat[IRC_NUM_COLORS] = -{ /* 0 */ "white", - /* 1 */ "black", - /* 2 */ "blue", - /* 3 */ "green", - /* 4 */ "lightred", - /* 5 */ "red", - /* 6 */ "magenta", - /* 7 */ "brown", - /* 8 */ "yellow", - /* 9 */ "lightgreen", - /* 10 */ "cyan", - /* 11 */ "lightcyan", - /* 12 */ "lightblue", - /* 13 */ "lightmagenta", - /* 14 */ "darkgray", - /* 15 */ "gray" +{ /* 0 */ "white", + /* 1 */ "black", + /* 2 */ "blue", + /* 3 */ "green", + /* 4 */ "lightred", + /* 5 */ "red", + /* 6 */ "magenta", + /* 7 */ "brown", + /* 8 */ "yellow", + /* 9 */ "lightgreen", + /* 10 */ "cyan", + /* 11 */ "lightcyan", + /* 12 */ "lightblue", + /* 13 */ "lightmagenta", + /* 14 */ "darkgray", + /* 15 */ "gray", + /* 16-23 */ "52", "94", "100", "58", "22", "29", "23", "24", + /* 24-31 */ "17", "54", "53", "89", "88", "130", "142", "64", + /* 32-39 */ "28", "35", "30", "25", "18", "91", "90", "125", + /* 40-47 */ "124", "166", "184", "106", "34", "49", "37", "33", + /* 48-55 */ "19", "129", "127", "161", "196", "208", "226", "154", + /* 56-63 */ "46", "86", "51", "75", "21", "171", "201", "198", + /* 64-71 */ "203", "215", "227", "191", "83", "122", "87", "111", + /* 72-79 */ "63", "177", "207", "205", "217", "223", "229", "193", + /* 80-87 */ "157", "158", "159", "153", "147", "183", "219", "212", + /* 88-95 */ "16", "233", "235", "237", "239", "241", "244", "247", + /* 96-98 */ "250", "254", "231", + /* 99 */ "default", }; char irc_color_term2irc[IRC_COLOR_TERM2IRC_NUM_COLORS] = { /* term > IRC */ diff --git a/src/plugins/irc/irc-color.h b/src/plugins/irc/irc-color.h index 287b1090aad..c1d2c8f78b8 100644 --- a/src/plugins/irc/irc-color.h +++ b/src/plugins/irc/irc-color.h @@ -20,7 +20,7 @@ #ifndef WEECHAT_IRC_COLOR_H #define WEECHAT_IRC_COLOR_H 1 -#define IRC_NUM_COLORS 16 +#define IRC_NUM_COLORS 100 /* * shift ncurses colors for compatibility with colors