1
0
mirror of https://github.com/irssi/irssi.git synced 2024-12-04 14:46:39 -05:00

Make hilight priority work

This commit is contained in:
vague666 2020-10-23 21:49:09 +02:00
parent 17c6c22c89
commit eb4174ee1e

View File

@ -244,6 +244,8 @@ HILIGHT_REC *hilight_match(SERVER_REC *server, const char *channel,
GSList *tmp; GSList *tmp;
CHANNEL_REC *chanrec; CHANNEL_REC *chanrec;
NICK_REC *nickrec; NICK_REC *nickrec;
HILIGHT_REC *tmprec;
int priority = -1;
g_return_val_if_fail(str != NULL, NULL); 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) && hilight_match_channel(rec, channel) &&
(rec->servertag == NULL || (rec->servertag == NULL ||
(server != NULL && g_ascii_strcasecmp(rec->servertag, server->tag) == 0)) && (server != NULL && g_ascii_strcasecmp(rec->servertag, server->tag) == 0)) &&
hilight_match_text(rec, str, match_beg, match_end)) hilight_match_text(rec, str, match_beg, match_end) &&
return rec; rec->priority > priority) {
tmprec = rec;
priority = rec->priority;
}
} }
return NULL; return tmprec;
} }
static char *hilight_get_act_color(HILIGHT_REC *rec) static char *hilight_get_act_color(HILIGHT_REC *rec)