From eb4174ee1eabbee37622e8eb827719a16007f11f Mon Sep 17 00:00:00 2001 From: vague666 Date: Fri, 23 Oct 2020 21:49:09 +0200 Subject: [PATCH] Make hilight priority work --- src/fe-common/core/hilight-text.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/fe-common/core/hilight-text.c b/src/fe-common/core/hilight-text.c index 2fe6068b..22e46ffa 100644 --- a/src/fe-common/core/hilight-text.c +++ b/src/fe-common/core/hilight-text.c @@ -244,6 +244,8 @@ HILIGHT_REC *hilight_match(SERVER_REC *server, const char *channel, GSList *tmp; CHANNEL_REC *chanrec; NICK_REC *nickrec; + HILIGHT_REC *tmprec; + int priority = -1; g_return_val_if_fail(str != NULL, NULL); @@ -274,11 +276,14 @@ HILIGHT_REC *hilight_match(SERVER_REC *server, const char *channel, hilight_match_channel(rec, channel) && (rec->servertag == NULL || (server != NULL && g_ascii_strcasecmp(rec->servertag, server->tag) == 0)) && - hilight_match_text(rec, str, match_beg, match_end)) - return rec; + hilight_match_text(rec, str, match_beg, match_end) && + rec->priority > priority) { + tmprec = rec; + priority = rec->priority; + } } - return NULL; + return tmprec; } static char *hilight_get_act_color(HILIGHT_REC *rec)