2000-04-26 04:03:38 -04:00
|
|
|
#ifndef __IGNORE_H
|
|
|
|
#define __IGNORE_H
|
|
|
|
|
2000-11-06 19:06:35 -05:00
|
|
|
#ifdef HAVE_REGEX_H
|
|
|
|
# include <regex.h>
|
|
|
|
#endif
|
2000-10-11 18:01:23 -04:00
|
|
|
|
2000-04-26 04:03:38 -04:00
|
|
|
typedef struct {
|
2001-01-28 02:22:22 -05:00
|
|
|
int level; /* ignore these levels */
|
2000-04-26 04:03:38 -04:00
|
|
|
char *mask; /* nick mask */
|
2001-02-22 01:09:48 -05:00
|
|
|
char *servertag; /* this is for autoignoring */
|
2000-04-26 04:03:38 -04:00
|
|
|
char **channels; /* ignore only in these channels */
|
|
|
|
char *pattern; /* text body must match this pattern */
|
|
|
|
|
2000-07-23 10:41:42 -04:00
|
|
|
int time; /* time in sec for temp ignores */
|
|
|
|
int time_tag;
|
|
|
|
|
2001-02-22 01:09:48 -05:00
|
|
|
unsigned int autoignore:1;
|
2001-01-28 02:22:22 -05:00
|
|
|
unsigned int exception:1; /* *don't* ignore */
|
2000-11-23 16:40:07 -05:00
|
|
|
unsigned int regexp:1;
|
|
|
|
unsigned int fullword:1;
|
|
|
|
unsigned int replies:1; /* ignore replies to nick in channel */
|
2000-11-06 19:06:35 -05:00
|
|
|
#ifdef HAVE_REGEX_H
|
2000-11-23 16:40:07 -05:00
|
|
|
unsigned int regexp_compiled:1; /* should always be TRUE, unless regexp is invalid */
|
2000-11-06 19:06:35 -05:00
|
|
|
regex_t preg;
|
|
|
|
#endif
|
2000-04-26 04:03:38 -04:00
|
|
|
} IGNORE_REC;
|
|
|
|
|
|
|
|
extern GSList *ignores;
|
|
|
|
|
2000-10-09 19:40:18 -04:00
|
|
|
int ignore_check(SERVER_REC *server, const char *nick, const char *host,
|
2000-04-26 04:03:38 -04:00
|
|
|
const char *channel, const char *text, int level);
|
|
|
|
|
|
|
|
IGNORE_REC *ignore_find(const char *servertag, const char *mask, char **channels);
|
|
|
|
|
|
|
|
void ignore_add_rec(IGNORE_REC *rec);
|
|
|
|
void ignore_update_rec(IGNORE_REC *rec);
|
|
|
|
|
|
|
|
void ignore_init(void);
|
|
|
|
void ignore_deinit(void);
|
|
|
|
|
|
|
|
#endif
|