simplify ignore hidden/no_act code

This commit is contained in:
ailin-nemui 2018-09-17 12:48:42 +02:00
commit 7e9f8c694b
6 changed files with 45 additions and 110 deletions

View file

@ -191,6 +191,22 @@ int ignore_check(SERVER_REC *server, const char *nick, const char *host,
return ignore_check_flags(server, nick, host, channel, text, level, 0);
}
int ignore_check_plus(SERVER_REC *server, const char *nick, const char *address,
const char *target, const char *msg, int *level, int test_ignore) {
int olevel = *level;
if (test_ignore && ignore_check(server, nick, address, target, msg, olevel))
return TRUE;
if (ignore_check_flags(server, nick, address, target, msg, olevel, MSGLEVEL_NO_ACT))
*level |= MSGLEVEL_NO_ACT;
if (ignore_check_flags(server, nick, address, target, msg, olevel, MSGLEVEL_HIDDEN))
*level |= MSGLEVEL_HIDDEN;
return FALSE;
}
IGNORE_REC *ignore_find_full(const char *servertag, const char *mask, const char *pattern,
char **channels, const int flags)
{

View file

@ -27,6 +27,8 @@ int ignore_check(SERVER_REC *server, const char *nick, const char *host,
const char *channel, const char *text, int level);
int ignore_check_flags(SERVER_REC *server, const char *nick, const char *host,
const char *channel, const char *text, int level, int flags);
int ignore_check_plus(SERVER_REC *server, const char *nick, const char *host,
const char *channel, const char *text, int *level, int test_ignore);
enum {
IGNORE_FIND_PATTERN = 0x01, /* Match the pattern */