]> jfr.im git - irc/rqf/shadowircd.git/blame - extensions/chm_sslonly_compat.c
New extensions documented + typo fixed
[irc/rqf/shadowircd.git] / extensions / chm_sslonly_compat.c
CommitLineData
13683170
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"
10
11/* XXX prototypes */
12void 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);
15void 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/* end yucky prototypes */
19
20static int _modinit(void);
21static void _moddeinit(void);
22static void chm_sslonly(struct Client *source_p, struct Channel *chptr,
23 int alevel, int parc, int *parn,
24 const char **parv, int *errors, int dir, char c, long mode_type);
25
26DECLARE_MODULE_AV1(chm_sslonly_compat, _modinit, _moddeinit, NULL, NULL, NULL, "$Revision$");
27
28static int
29_modinit(void)
30{
31 chmode_table['S'].set_func = chm_sslonly;
32 chmode_table['S'].mode_type = 0;
33
34 return 0;
35}
36
37static void
38_moddeinit(void)
39{
40 chmode_table['S'].set_func = chm_nosuch;
41 chmode_table['S'].mode_type = 0;
42}
43
44static void
45chm_sslonly(struct Client *source_p, struct Channel *chptr,
46 int alevel, int parc, int *parn,
47 const char **parv, int *errors, int dir, char c, long mode_type)
48{
49 int newparn = 0;
50 const char *newparv[] = { "$~z" };
51
52 if (MyClient(source_p))
53 chm_ban(source_p, chptr, alevel, 1, &newparn, newparv,
54 errors, dir, 'b', CHFL_BAN);
55 else
56 chm_nosuch(source_p, chptr, alevel, parc, parn, parv,
57 errors, dir, c, mode_type);
58}