]> jfr.im git - solanum.git/blame - extensions/chm_sslonly_compat.c
chmode: Get elevated access for op-only queries
[solanum.git] / extensions / chm_sslonly_compat.c
CommitLineData
6d1a8b6e
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"
c84557ac 10#include "chmode.h"
6d1a8b6e 11
eeabf33a
EM
12static const char chm_sslonly_compat_desc[] =
13 "Adds an emulated channel mode +S which is converted into mode +b $~z";
14
6d1a8b6e
VY
15static int _modinit(void);
16static void _moddeinit(void);
17static void chm_sslonly(struct Client *source_p, struct Channel *chptr,
04952c32 18 int alevel, const char *arg, int *errors, int dir, char c, long mode_type);
6d1a8b6e 19
581dad19 20DECLARE_MODULE_AV2(chm_sslonly_compat, _modinit, _moddeinit, NULL, NULL, NULL, NULL, NULL, chm_sslonly_compat_desc);
6d1a8b6e
VY
21
22static int
23_modinit(void)
24{
04952c32 25 chmode_table['S'] = (struct ChannelMode){ chm_sslonly, 0, 0 };
6d1a8b6e
VY
26 return 0;
27}
28
29static void
30_moddeinit(void)
31{
04952c32 32 chmode_table['S'] = (struct ChannelMode){ chm_nosuch, 0, 0 };
6d1a8b6e
VY
33}
34
35static void
36chm_sslonly(struct Client *source_p, struct Channel *chptr,
04952c32 37 int alevel, const char *arg, int *errors, int dir, char c, long mode_type)
6d1a8b6e 38{
6d1a8b6e 39 if (MyClient(source_p))
04952c32 40 chm_ban(source_p, chptr, alevel, "$~z",
6d1a8b6e
VY
41 errors, dir, 'b', CHFL_BAN);
42 else
04952c32 43 chm_nosuch(source_p, chptr, alevel, NULL,
6d1a8b6e
VY
44 errors, dir, c, mode_type);
45}