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

Merge pull request #892 from dwfreed/fix-ignore-flags

core/ignore: fix ignore_match_level handling of flag levels
This commit is contained in:
ailin-nemui 2018-08-02 13:42:24 +02:00 committed by GitHub
commit 0c94d44f52
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -82,11 +82,17 @@ static int ignore_match_pattern(IGNORE_REC *rec, const char *text)
* However we also want to allow NO_ACT combined with levels, so mask it out and
* match levels if set. */
#define FLAG_MSGLEVELS ( MSGLEVEL_NO_ACT | MSGLEVEL_HIDDEN )
#define ignore_match_level(rec, level) \
(((level & FLAG_MSGLEVELS) != 0) ? \
((~FLAG_MSGLEVELS & level) & (rec)->level) != 0 : \
((rec)->level & FLAG_MSGLEVELS ? 0 : \
(level & (rec)->level) != 0))
static int ignore_match_level(IGNORE_REC *rec, int level)
{
if (level & FLAG_MSGLEVELS) {
int flaglevel = level & FLAG_MSGLEVELS;
return (level & rec->level) && (flaglevel & rec->level);
} else if (!(rec->level & FLAG_MSGLEVELS)) {
return (level & rec->level);
} else {
return FALSE;
}
}
#define ignore_match_nickmask(rec, nick, nickmask) \
((rec)->mask == NULL || \