irssi/src/core/ignore.h
David Leadbeater 819f9d16c9 Change NO_ACT so it can be used in addition to other ignores
This results in a more flexible system and is less surprising as it means levels
can be used in the way they normally can in an ignore.

As an example the current approach to NO_ACT provides no way to let HILIGHTS
be shown, with this change /set activity_hide_targets can be recreated with:
  /ignore #channel NO_ACT
  /ignore #channel -except -regexp -pattern . NO_ACT HILIGHTS
(but obviously this can be configured in many more ways if desired).
2014-06-30 00:31:53 +01:00

44 lines
1.2 KiB
C

#ifndef __IGNORE_H
#define __IGNORE_H
#ifdef HAVE_REGEX_H
# include <regex.h>
#endif
typedef struct _IGNORE_REC IGNORE_REC;
struct _IGNORE_REC {
int level; /* ignore these levels */
char *mask; /* nick mask */
char *servertag; /* this is for autoignoring */
char **channels; /* ignore only in these channels */
char *pattern; /* text body must match this pattern */
time_t unignore_time; /* time in sec for temp ignores */
unsigned int exception:1; /* *don't* ignore */
unsigned int regexp:1;
unsigned int fullword:1;
unsigned int replies:1; /* ignore replies to nick in channel */
#ifdef HAVE_REGEX_H
unsigned int regexp_compiled:1; /* should always be TRUE, unless regexp is invalid */
regex_t preg;
#endif
};
extern GSList *ignores;
int ignore_check(SERVER_REC *server, const char *nick, const char *host,
const char *channel, const char *text, int level);
IGNORE_REC *ignore_find(const char *servertag, const char *mask, char **channels);
IGNORE_REC *ignore_find_noact(const char *servertag, const char *mask, char **channels, int noact);
void ignore_add_rec(IGNORE_REC *rec);
void ignore_update_rec(IGNORE_REC *rec);
void ignore_init(void);
void ignore_deinit(void);
#endif