From 1a20ef41c08c60ee1a5ba11eff3b8e86e528d5b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Helleu?= Date: Sun, 21 Sep 2014 11:52:58 +0200 Subject: [PATCH] core: fix highlight of IRC action messages when option irc.look.nick_mode is set to "action" or "both" (closes #206) --- ChangeLog.asciidoc | 2 ++ src/gui/gui-line.c | 9 +++++++++ 2 files changed, 11 insertions(+) diff --git a/ChangeLog.asciidoc b/ChangeLog.asciidoc index 71282bb36..57816e92a 100644 --- a/ChangeLog.asciidoc +++ b/ChangeLog.asciidoc @@ -28,6 +28,8 @@ http://weechat.org/files/releasenotes/ReleaseNotes-devel.html[release notes] === Bugs fixed +* core: fix highlight of IRC action messages when option irc.look.nick_mode is + set to "action" or "both" (closes #206) * core: fix compilation of plugin API functions (macros) when compiler optimizations are enabled (closes #200) * core: fix window/buffer pointers used in command /eval diff --git a/src/gui/gui-line.c b/src/gui/gui-line.c index cc27c64a9..21cf56de6 100644 --- a/src/gui/gui-line.c +++ b/src/gui/gui-line.c @@ -782,7 +782,16 @@ gui_line_has_highlight (struct t_gui_line *line) { length = strlen (ptr_nick); if (strncmp (ptr_msg_no_color, ptr_nick, length) == 0) + { + /* skip nick at beginning (for example: "FlashCode") */ ptr_msg_no_color += length; + } + else if (ptr_msg_no_color[0] + && (strncmp (ptr_msg_no_color + 1, ptr_nick, length) == 0)) + { + /* skip prefix and nick at beginning (for example: "@FlashCode") */ + ptr_msg_no_color += length + 1; + } } /*