]>
Commit | Line | Data |
---|---|---|
ec40aa0d VY |
1 | /* |
2 | * Treat cmode +-O as +-iI $o. | |
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 | void chm_simple(struct Client *source_p, struct Channel *chptr, | |
19 | int alevel, int parc, int *parn, | |
20 | const char **parv, int *errors, int dir, char c, long mode_type); | |
21 | /* end yucky prototypes */ | |
22 | ||
23 | static int _modinit(void); | |
24 | static void _moddeinit(void); | |
25 | static void chm_operonly(struct Client *source_p, struct Channel *chptr, | |
26 | int alevel, int parc, int *parn, | |
27 | const char **parv, int *errors, int dir, char c, long mode_type); | |
28 | ||
29 | DECLARE_MODULE_AV1(chm_operonly_compat, _modinit, _moddeinit, NULL, NULL, NULL, "$Revision$"); | |
30 | ||
31 | static int | |
32 | _modinit(void) | |
33 | { | |
34 | chmode_table['O'].set_func = chm_operonly; | |
35 | chmode_table['O'].mode_type = 0; | |
36 | ||
37 | return 0; | |
38 | } | |
39 | ||
40 | static void | |
41 | _moddeinit(void) | |
42 | { | |
43 | chmode_table['O'].set_func = chm_nosuch; | |
44 | chmode_table['O'].mode_type = 0; | |
45 | } | |
46 | ||
47 | static void | |
48 | chm_operonly(struct Client *source_p, struct Channel *chptr, | |
49 | int alevel, int parc, int *parn, | |
50 | const char **parv, int *errors, int dir, char c, long mode_type) | |
51 | { | |
52 | int newparn = 0; | |
53 | const char *newparv[] = { "$o" }; | |
54 | ||
55 | if (MyClient(source_p)) { | |
56 | chm_simple(source_p, chptr, alevel, parc, parn, parv, | |
57 | errors, dir, 'i', MODE_INVITEONLY); | |
58 | chm_ban(source_p, chptr, alevel, 1, &newparn, newparv, | |
59 | errors, dir, 'I', CHFL_INVEX); | |
60 | } else | |
61 | chm_nosuch(source_p, chptr, alevel, parc, parn, parv, | |
62 | errors, dir, c, mode_type); | |
63 | } |