]> jfr.im git - solanum.git/blame - extensions/chm_quietunreg_compat.c
m_starttls: fix fucked-up merge
[solanum.git] / extensions / chm_quietunreg_compat.c
CommitLineData
b50c1127
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"
c84557ac 11#include "chmode.h"
b50c1127
JT
12
13static int _modinit(void);
14static void _moddeinit(void);
15static 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);
581dad19
EM
18static const char chm_quietunreg_compat_desc[] =
19 "Adds an emulated channel mode +R which is converted into mode +q $~a";
b50c1127 20
581dad19 21DECLARE_MODULE_AV2(chm_quietunreg_compat, _modinit, _moddeinit, NULL, NULL, NULL, NULL, NULL, chm_quietunreg_compat_desc);
b50c1127
JT
22
23static int
24_modinit(void)
25{
26 chmode_table['R'].set_func = chm_quietunreg;
27 chmode_table['R'].mode_type = 0;
28
29 return 0;
30}
31
32static void
33_moddeinit(void)
34{
35 chmode_table['R'].set_func = chm_nosuch;
36 chmode_table['R'].mode_type = 0;
37}
38
39static void
40chm_quietunreg(struct Client *source_p, struct Channel *chptr,
41 int alevel, int parc, int *parn,
42 const char **parv, int *errors, int dir, char c, long mode_type)
43{
44 int newparn = 0;
45 const char *newparv[] = { "$~a" };
46
47 if (MyClient(source_p))
48 chm_ban(source_p, chptr, alevel, 1, &newparn, newparv,
49 errors, dir, 'q', CHFL_QUIET);
50 else
51 chm_nosuch(source_p, chptr, alevel, parc, parn, parv,
52 errors, dir, c, mode_type);
53}