From 575a5a3b8b69fba6a92666509a89a3e684668793 Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Tue, 4 Dec 2001 14:08:34 +0000 Subject: [PATCH] Don't match nicks in -nick hilights. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2191 dbcabf3a-b0e7-0310-adc4-f8d773084564 --- src/fe-common/core/hilight-text.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/fe-common/core/hilight-text.c b/src/fe-common/core/hilight-text.c index b280c1f5..ffb90a88 100644 --- a/src/fe-common/core/hilight-text.c +++ b/src/fe-common/core/hilight-text.c @@ -282,6 +282,7 @@ static void sig_print_text(TEXT_DEST_REC *dest, const char *text, HILIGHT_REC *hilight; char *color, *newstr; int old_level, hilight_start, hilight_end, hilight_len; + int nick_match; if (dest->level & MSGLEVEL_NOHILIGHT) return; @@ -294,11 +295,15 @@ static void sig_print_text(TEXT_DEST_REC *dest, const char *text, if (hilight == NULL) return; - /* update the level / hilight info */ - old_level = dest->level; - hilight_update_text_dest(dest, hilight); + nick_match = hilight->nick && (dest->level & (MSGLEVEL_PUBLIC|MSGLEVEL_ACTIONS)) == MSGLEVEL_PUBLIC; - if (hilight->nick && (dest->level & (MSGLEVEL_PUBLIC|MSGLEVEL_ACTIONS)) == MSGLEVEL_PUBLIC) + if (!nick_match || (dest->level & MSGLEVEL_HILIGHT)) { + /* update the level / hilight info */ + old_level = dest->level; + hilight_update_text_dest(dest, hilight); + } + + if (nick_match) return; /* fe-messages.c should have taken care of this */ if (old_level & MSGLEVEL_HILIGHT) {