diff options
author | vague666 <jari.matilainen@gmail.com> | 2018-06-06 11:03:44 +0200 |
---|---|---|
committer | vague666 <jari.matilainen@gmail.com> | 2018-06-06 11:03:44 +0200 |
commit | 1547248e9448c22476a56c630ee18d95a57dc05f (patch) | |
tree | 2cf6ffacce0c953e3b54d8674e08464fa7a66406 /src/fe-common/core | |
parent | ac3af3fb56d98b884d03646e3c15435c8a435bf3 (diff) | |
download | irssi-1547248e9448c22476a56c630ee18d95a57dc05f.zip |
simplify code
Diffstat (limited to 'src/fe-common/core')
-rw-r--r-- | src/fe-common/core/fe-ignore.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/fe-common/core/fe-ignore.c b/src/fe-common/core/fe-ignore.c index 88dc48f7..39c4dd9f 100644 --- a/src/fe-common/core/fe-ignore.c +++ b/src/fe-common/core/fe-ignore.c @@ -118,7 +118,7 @@ static void cmd_ignore(const char *data) char *patternarg, *chanarg, *mask, *levels, *timestr, *servertag; char **channels; void *free_arg; - int new_ignore, msecs, level; + int new_ignore, msecs, level, flags; if (*data == '\0') { cmd_ignore_show(); @@ -156,9 +156,13 @@ static void cmd_ignore(const char *data) channels = (chanarg == NULL || *chanarg == '\0') ? NULL : g_strsplit(chanarg, ",", -1); - rec = ignore_find_full(servertag, mask, patternarg, channels, - IGNORE_FIND_PATTERN | ((level & MSGLEVEL_NO_ACT) ? IGNORE_FIND_NOACT : 0) | - ((level & MSGLEVEL_HIDDEN) ? IGNORE_FIND_HIDDEN : 0)); + flags = IGNORE_FIND_PATTERN; + if (level & MSGLEVEL_NO_ACT) + flags |= IGNORE_FIND_NOACT; + if (level & MSGLEVEL_HIDDEN) + flags |= IGNORE_FIND_HIDDEN; + + rec = ignore_find_full(servertag, mask, patternarg, channels, flags); new_ignore = rec == NULL; if (rec == NULL) { |