From d03eb52d4992c46b01c47d076ae5ef5aa68be10c Mon Sep 17 00:00:00 2001 From: Sebastien Helleu Date: Sun, 1 Dec 2013 11:28:32 +0100 Subject: [PATCH] irc: use color code 0x16 (ctrl-V) for reverse video in messages Other clients are using 0x16, and not 0x12 that was the default in WeeChat (which was able to decode both 0x12 and 0x16). Now the 0x12 is not decoded and does not make reverse video any more. --- ChangeLog | 1 + src/plugins/irc/irc-color.c | 14 ++++++-------- src/plugins/irc/irc-color.h | 6 ++---- 3 files changed, 9 insertions(+), 12 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5a05ca935..a7aa46c71 100644 --- a/ChangeLog +++ b/ChangeLog @@ -42,6 +42,7 @@ http://weechat.org/files/releasenotes/ReleaseNotes-devel.html[release notes] * aspell: fix detection of nicks with non-alphanumeric chars * guile: disable guile gmp allocator (fix crash on unload of relay plugin) (bug #40628) +* irc: use color code 0x16 (ctrl-V) for reverse video in messages * irc: use option irc.network.colors_send instead of irc.network.colors_receive when displaying messages sent by commands /away, /me, /msg, /notice, /query * irc: fix memory leak when checking the value of ssl_priorities option in diff --git a/src/plugins/irc/irc-color.c b/src/plugins/irc/irc-color.c index 4deaaaa69..08b57f0f9 100644 --- a/src/plugins/irc/irc-color.c +++ b/src/plugins/irc/irc-color.c @@ -121,7 +121,6 @@ irc_color_decode (const char *string, int keep_colors) ptr_string++; break; case IRC_COLOR_REVERSE_CHAR: - case IRC_COLOR_REVERSE2_CHAR: if (keep_colors) { snprintf (str_to_add, sizeof (str_to_add), "%s", @@ -301,8 +300,7 @@ irc_color_decode_for_user_entry (const char *string) ptr_string++; break; case IRC_COLOR_REVERSE_CHAR: - case IRC_COLOR_REVERSE2_CHAR: - out[out_pos++] = 0x12; + out[out_pos++] = 0x16; ptr_string++; break; case IRC_COLOR_ITALIC_CHAR: @@ -406,16 +404,16 @@ irc_color_encode (const char *string, int keep_colors) out[out_pos++] = IRC_COLOR_RESET_CHAR; ptr_string++; break; - case 0x12: /* ^R */ - if (keep_colors) - out[out_pos++] = IRC_COLOR_REVERSE_CHAR; - ptr_string++; - break; case 0x15: /* ^U */ if (keep_colors) out[out_pos++] = IRC_COLOR_UNDERLINE_CHAR; ptr_string++; break; + case 0x16: /* ^V */ + if (keep_colors) + out[out_pos++] = IRC_COLOR_REVERSE_CHAR; + ptr_string++; + break; default: length = weechat_utf8_char_size ((char *)ptr_string); if (length == 0) diff --git a/src/plugins/irc/irc-color.h b/src/plugins/irc/irc-color.h index 271872434..c8ef4d606 100644 --- a/src/plugins/irc/irc-color.h +++ b/src/plugins/irc/irc-color.h @@ -46,10 +46,8 @@ #define IRC_COLOR_RESET_STR "\x0F" #define IRC_COLOR_FIXED_CHAR '\x11' #define IRC_COLOR_FIXED_STR "\x11" -#define IRC_COLOR_REVERSE_CHAR '\x12' -#define IRC_COLOR_REVERSE_STR "\x12" -#define IRC_COLOR_REVERSE2_CHAR '\x16' -#define IRC_COLOR_REVERSE2_STR "\x16" +#define IRC_COLOR_REVERSE_CHAR '\x16' +#define IRC_COLOR_REVERSE_STR "\x16" #define IRC_COLOR_ITALIC_CHAR '\x1D' #define IRC_COLOR_ITALIC_STR "\x1D" #define IRC_COLOR_UNDERLINE_CHAR '\x1F'