]> jfr.im git - irc/rqf/shadowircd.git/blame - extensions/chm_quietunreg_compat.c
mode api: Remove most modes from the chmode_table, and have them initialized in modes...
[irc/rqf/shadowircd.git] / extensions / chm_quietunreg_compat.c
CommitLineData
00fe56c5
JT
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"
b5482c91 11#include "chmode.h"
1fe75e33
G
12#include "channel.h"
13
14struct module_modes ModuleModes;
00fe56c5
JT
15
16static int _modinit(void);
17static void _moddeinit(void);
18static void chm_quietunreg(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
22DECLARE_MODULE_AV1(chm_quietunreg_compat, _modinit, _moddeinit, NULL, NULL, NULL, "$Revision$");
23
24static int
25_modinit(void)
26{
27 chmode_table['R'].set_func = chm_quietunreg;
28 chmode_table['R'].mode_type = 0;
29
30 return 0;
31}
32
33static void
34_moddeinit(void)
35{
36 chmode_table['R'].set_func = chm_nosuch;
37 chmode_table['R'].mode_type = 0;
38}
39
40static void
41chm_quietunreg(struct Client *source_p, struct Channel *chptr,
42 int alevel, int parc, int *parn,
43 const char **parv, int *errors, int dir, char c, long mode_type)
44{
45 int newparn = 0;
46 const char *newparv[] = { "$~a" };
47
48 if (MyClient(source_p))
49 chm_ban(source_p, chptr, alevel, 1, &newparn, newparv,
1fe75e33 50 errors, dir, 'q', ModuleModes.CHFL_QUIET);
00fe56c5
JT
51 else
52 chm_nosuch(source_p, chptr, alevel, parc, parn, parv,
53 errors, dir, c, mode_type);
54}