]>
Commit | Line | Data |
---|---|---|
13683170 VY |
1 | /* |
2 | * Treat cmode +-S as +-b $~z. | |
3 | */ | |
4 | ||
5 | #include "stdinc.h" | |
6 | #include "modules.h" | |
7 | #include "client.h" | |
8 | #include "hook.h" | |
9 | #include "ircd.h" | |
10 | ||
11 | /* XXX prototypes */ | |
12 | void chm_ban(struct Client *source_p, struct Channel *chptr, | |
13 | int alevel, int parc, int *parn, | |
14 | const char **parv, int *errors, int dir, char c, long mode_type); | |
15 | void chm_nosuch(struct Client *source_p, struct Channel *chptr, | |
16 | int alevel, int parc, int *parn, | |
17 | const char **parv, int *errors, int dir, char c, long mode_type); | |
18 | /* end yucky prototypes */ | |
19 | ||
20 | static int _modinit(void); | |
21 | static void _moddeinit(void); | |
22 | static void chm_sslonly(struct Client *source_p, struct Channel *chptr, | |
23 | int alevel, int parc, int *parn, | |
24 | const char **parv, int *errors, int dir, char c, long mode_type); | |
25 | ||
26 | DECLARE_MODULE_AV1(chm_sslonly_compat, _modinit, _moddeinit, NULL, NULL, NULL, "$Revision$"); | |
27 | ||
28 | static int | |
29 | _modinit(void) | |
30 | { | |
31 | chmode_table['S'].set_func = chm_sslonly; | |
32 | chmode_table['S'].mode_type = 0; | |
33 | ||
34 | return 0; | |
35 | } | |
36 | ||
37 | static void | |
38 | _moddeinit(void) | |
39 | { | |
40 | chmode_table['S'].set_func = chm_nosuch; | |
41 | chmode_table['S'].mode_type = 0; | |
42 | } | |
43 | ||
44 | static void | |
45 | chm_sslonly(struct Client *source_p, struct Channel *chptr, | |
46 | int alevel, int parc, int *parn, | |
47 | const char **parv, int *errors, int dir, char c, long mode_type) | |
48 | { | |
49 | int newparn = 0; | |
50 | const char *newparv[] = { "$~z" }; | |
51 | ||
52 | if (MyClient(source_p)) | |
53 | chm_ban(source_p, chptr, alevel, 1, &newparn, newparv, | |
54 | errors, dir, 'b', CHFL_BAN); | |
55 | else | |
56 | chm_nosuch(source_p, chptr, alevel, parc, parn, parv, | |
57 | errors, dir, c, mode_type); | |
58 | } |