]>
Commit | Line | Data |
---|---|---|
6d1a8b6e 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" | |
c84557ac | 10 | #include "chmode.h" |
6d1a8b6e VY |
11 | |
12 | static int _modinit(void); | |
13 | static void _moddeinit(void); | |
14 | static void chm_sslonly(struct Client *source_p, struct Channel *chptr, | |
15 | int alevel, int parc, int *parn, | |
16 | const char **parv, int *errors, int dir, char c, long mode_type); | |
17 | ||
18 | DECLARE_MODULE_AV1(chm_sslonly_compat, _modinit, _moddeinit, NULL, NULL, NULL, "$Revision$"); | |
19 | ||
20 | static int | |
21 | _modinit(void) | |
22 | { | |
23 | chmode_table['S'].set_func = chm_sslonly; | |
24 | chmode_table['S'].mode_type = 0; | |
25 | ||
26 | return 0; | |
27 | } | |
28 | ||
29 | static void | |
30 | _moddeinit(void) | |
31 | { | |
32 | chmode_table['S'].set_func = chm_nosuch; | |
33 | chmode_table['S'].mode_type = 0; | |
34 | } | |
35 | ||
36 | static void | |
37 | chm_sslonly(struct Client *source_p, struct Channel *chptr, | |
38 | int alevel, int parc, int *parn, | |
39 | const char **parv, int *errors, int dir, char c, long mode_type) | |
40 | { | |
41 | int newparn = 0; | |
42 | const char *newparv[] = { "$~z" }; | |
43 | ||
44 | if (MyClient(source_p)) | |
45 | chm_ban(source_p, chptr, alevel, 1, &newparn, newparv, | |
46 | errors, dir, 'b', CHFL_BAN); | |
47 | else | |
48 | chm_nosuch(source_p, chptr, alevel, parc, parn, parv, | |
49 | errors, dir, c, mode_type); | |
50 | } |