2000-04-26 08:03:38 +00:00
|
|
|
#ifndef __IGNORE_H
|
|
|
|
|
#define __IGNORE_H
|
|
|
|
|
|
2017-02-16 22:48:13 +01:00
|
|
|
#include "iregex.h"
|
2017-01-03 12:04:56 +01:00
|
|
|
|
2002-05-17 21:01:06 +00:00
|
|
|
typedef struct _IGNORE_REC IGNORE_REC;
|
|
|
|
|
|
|
|
|
|
struct _IGNORE_REC {
|
2001-01-28 07:22:22 +00:00
|
|
|
int level; /* ignore these levels */
|
2000-04-26 08:03:38 +00:00
|
|
|
char *mask; /* nick mask */
|
2001-02-22 06:09:48 +00:00
|
|
|
char *servertag; /* this is for autoignoring */
|
2000-04-26 08:03:38 +00:00
|
|
|
char **channels; /* ignore only in these channels */
|
|
|
|
|
char *pattern; /* text body must match this pattern */
|
|
|
|
|
|
2001-03-03 23:27:07 +00:00
|
|
|
time_t unignore_time; /* time in sec for temp ignores */
|
2000-07-23 14:41:42 +00:00
|
|
|
|
2001-01-28 07:22:22 +00:00
|
|
|
unsigned int exception:1; /* *don't* ignore */
|
2000-11-23 21:40:07 +00:00
|
|
|
unsigned int regexp:1;
|
|
|
|
|
unsigned int fullword:1;
|
|
|
|
|
unsigned int replies:1; /* ignore replies to nick in channel */
|
2017-02-16 22:48:13 +01:00
|
|
|
Regex *preg;
|
2002-05-17 21:01:06 +00:00
|
|
|
};
|
2000-04-26 08:03:38 +00:00
|
|
|
|
|
|
|
|
extern GSList *ignores;
|
|
|
|
|
|
2000-10-09 23:40:18 +00:00
|
|
|
int ignore_check(SERVER_REC *server, const char *nick, const char *host,
|
2000-04-26 08:03:38 +00:00
|
|
|
const char *channel, const char *text, int level);
|
|
|
|
|
|
2016-01-03 19:49:18 +01:00
|
|
|
enum {
|
2017-11-30 11:15:47 +01:00
|
|
|
IGNORE_FIND_PATTERN = 0x01, /* Match the pattern */
|
|
|
|
|
IGNORE_FIND_NOACT = 0x02, /* Exclude the targets with NOACT level */
|
2016-01-03 19:49:18 +01:00
|
|
|
};
|
|
|
|
|
|
2016-01-03 21:19:46 +01:00
|
|
|
IGNORE_REC *ignore_find_full (const char *servertag, const char *mask, const char *pattern,
|
|
|
|
|
char **channels, const int flags);
|
|
|
|
|
|
2017-11-30 11:15:47 +01:00
|
|
|
/* Convenience wrappers around ignore_find_full, for compatibility purpose */
|
2016-01-03 21:19:46 +01:00
|
|
|
|
|
|
|
|
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);
|
2000-04-26 08:03:38 +00:00
|
|
|
|
|
|
|
|
void ignore_add_rec(IGNORE_REC *rec);
|
|
|
|
|
void ignore_update_rec(IGNORE_REC *rec);
|
|
|
|
|
|
|
|
|
|
void ignore_init(void);
|
|
|
|
|
void ignore_deinit(void);
|
|
|
|
|
|
|
|
|
|
#endif
|