X-Git-Url: https://jfr.im/git/irc/quakenet/newserv.git/blobdiff_plain/c86edd1d9e5994aea33cfad3164e4827e591e7e6..e2527cba3979ffb1f5e9dfae3c8701f046ffee35:/helpmod2/hcensor.h diff --git a/helpmod2/hcensor.h b/helpmod2/hcensor.h index 5a53aa43..21d32299 100644 --- a/helpmod2/hcensor.h +++ b/helpmod2/hcensor.h @@ -3,18 +3,36 @@ #include "../lib/sstring.h" +/* forward declarations */ +struct hchannel_struct; +struct huser_struct; + +typedef enum +{ + HCENSOR_WARN, + HCENSOR_KICK, + HCENSOR_CHANBAN, + HCENSOR_BAN +} hcensor_type; + typedef struct hcensor_struct { sstring *pattern; sstring *reason; /* optional */ + hcensor_type type; + struct hcensor_struct *next; } hcensor; hcensor *hcensor_get_by_pattern(hcensor *, const char *); hcensor *hcensor_get_by_index(hcensor *, int); hcensor *hcensor_check(hcensor *, const char *); /* first matching pattern is returned, NULL if ok */ -hcensor *hcensor_add(hcensor **, const char*, const char*); +hcensor *hcensor_add(hcensor **, const char*, const char*, hcensor_type); hcensor *hcensor_del(hcensor **, hcensor *); +/* Handle a censor match, if returnvalue is non-zero then the user was removed from channel */ +int hcensor_match(struct hchannel_struct*, struct huser_struct*, hcensor*); +const char *hcensor_get_typename(hcensor_type); + int hcensor_count(hcensor *); void hcensor_del_all(hcensor **);