1
0
mirror of https://github.com/irssi/irssi.git synced 2024-10-06 04:53:38 -04:00

Add prio check to hilight_nick_cache also

This commit is contained in:
vague666 2020-10-26 11:01:03 +01:00
parent 4fb10322d1
commit 8f4f0be6d4

View File

@ -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;
}