mirror of
https://github.com/irssi/irssi.git
synced 2026-08-17 15:42:26 +02:00
simplify ignore hidden/no_act code
This commit is contained in:
parent
b9a274a81d
commit
7e9f8c694b
6 changed files with 45 additions and 110 deletions
|
|
@ -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)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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 */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue