]>
Commit | Line | Data |
---|---|---|
25b7d0fa P |
1 | #include "../nick/nick.h" |
2 | #include "../channel/channel.h" | |
3 | ||
4 | typedef struct { | |
5 | int count; | |
6 | time_t created; | |
7 | time_t expire; | |
8 | } rq_flood; | |
9 | ||
10 | typedef struct { | |
11 | sstring *pattern; | |
12 | sstring *reason; | |
13 | ||
14 | sstring *creator; | |
15 | time_t created; | |
16 | time_t expires; | |
17 | } rq_block; | |
18 | ||
19 | extern array rqblocks; | |
20 | ||
21 | #define RQ_BLOCKFILE "rqblocks" | |
22 | #define RQ_BLOCKLEN 256 | |
23 | ||
24 | #define RQ_SPAMCOUNT 5 | |
25 | #define RQ_SPAMBLOCK 3600 | |
26 | ||
8ee2e8b2 | 27 | int rq_initblocks(void); |
25b7d0fa P |
28 | void rq_finiblocks(void); |
29 | ||
30 | int rq_loadblocks(void); | |
31 | int rq_saveblocks(void); | |
32 | ||
33 | /* long-term blocks */ | |
34 | rq_block *rq_findblock(const char *pattern); | |
35 | void rq_addblock(const char *pattern, const char *reason, const char *creator, time_t created, time_t expires); | |
36 | int rq_removeblock(const char *pattern); | |
37 | ||
38 | /* anti-spam blocks */ | |
39 | int rq_isspam(nick *np); | |
40 | time_t rq_blocktime(nick *np); |