]> jfr.im git - irc/rqf/shadowircd.git/blob - extensions/chm_quietunreg_compat.c
Backed out changeset 3097ade953f5
[irc/rqf/shadowircd.git] / extensions / chm_quietunreg_compat.c
1 /*
2 * Treat cmode +-R as +-q $~a.
3 * -- jilles
4 */
5
6 #include "stdinc.h"
7 #include "modules.h"
8 #include "client.h"
9 #include "hook.h"
10 #include "ircd.h"
11 #include "chmode.h"
12
13 static int _modinit(void);
14 static void _moddeinit(void);
15 static void chm_quietunreg(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
19 DECLARE_MODULE_AV1(chm_quietunreg_compat, _modinit, _moddeinit, NULL, NULL, NULL, "$Revision$");
20
21 static int
22 _modinit(void)
23 {
24 chmode_table['R'].set_func = chm_quietunreg;
25 chmode_table['R'].mode_type = 0;
26
27 return 0;
28 }
29
30 static void
31 _moddeinit(void)
32 {
33 chmode_table['R'].set_func = chm_nosuch;
34 chmode_table['R'].mode_type = 0;
35 }
36
37 static void
38 chm_quietunreg(struct Client *source_p, struct Channel *chptr,
39 int alevel, int parc, int *parn,
40 const char **parv, int *errors, int dir, char c, long mode_type)
41 {
42 int newparn = 0;
43 const char *newparv[] = { "$~a" };
44
45 if (MyClient(source_p))
46 chm_ban(source_p, chptr, alevel, 1, &newparn, newparv,
47 errors, dir, 'q', CHFL_QUIET);
48 else
49 chm_nosuch(source_p, chptr, alevel, parc, parn, parv,
50 errors, dir, c, mode_type);
51 }