From 8f4f0be6d48b169f20389d73f3d7cd3259d6f5a9 Mon Sep 17 00:00:00 2001 From: vague666 Date: Mon, 26 Oct 2020 11:01:03 +0100 Subject: [PATCH] Add prio check to hilight_nick_cache also --- src/fe-common/core/hilight-text.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/fe-common/core/hilight-text.c b/src/fe-common/core/hilight-text.c index fc213533..4e971d75 100644 --- a/src/fe-common/core/hilight-text.c +++ b/src/fe-common/core/hilight-text.c @@ -674,6 +674,7 @@ static void hilight_nick_cache(GHashTable *list, CHANNEL_REC *channel, HILIGHT_REC *match; char *nickmask; int len, best_match; + int priority = -1; if (nick->host == NULL) return; /* don't check until host is known */ @@ -684,11 +685,12 @@ static void hilight_nick_cache(GHashTable *list, CHANNEL_REC *channel, for (tmp = hilights; tmp != NULL; tmp = tmp->next) { HILIGHT_REC *rec = tmp->data; - if (rec->nickmask && + if (rec->priority > priority && rec->nickmask && hilight_match_channel(rec, channel->name) && match_wildcards(rec->text, nickmask)) { len = strlen(rec->text); if (best_match < len) { + priority = rec->priority; best_match = len; match = rec; }