2008-04-08 19:29:19 +02:00
|
|
|
/*
|
|
|
|
* Treat cmode +-S as +-b $~z.
|
|
|
|
*/
|
|
|
|
|
2016-08-13 05:05:54 +02:00
|
|
|
using namespace ircd;
|
|
|
|
|
2016-03-09 08:29:41 +01:00
|
|
|
static const char chm_sslonly_compat_desc[] =
|
|
|
|
"Adds an emulated channel mode +S which is converted into mode +b $~z";
|
|
|
|
|
2008-04-08 19:29:19 +02:00
|
|
|
static int _modinit(void);
|
|
|
|
static void _moddeinit(void);
|
|
|
|
static void chm_sslonly(struct Client *source_p, struct Channel *chptr,
|
|
|
|
int alevel, int parc, int *parn,
|
|
|
|
const char **parv, int *errors, int dir, char c, long mode_type);
|
|
|
|
|
2016-03-07 06:48:27 +01:00
|
|
|
DECLARE_MODULE_AV2(chm_sslonly_compat, _modinit, _moddeinit, NULL, NULL, NULL, NULL, NULL, chm_sslonly_compat_desc);
|
2008-04-08 19:29:19 +02:00
|
|
|
|
|
|
|
static int
|
|
|
|
_modinit(void)
|
|
|
|
{
|
|
|
|
chmode_table['S'].set_func = chm_sslonly;
|
|
|
|
chmode_table['S'].mode_type = 0;
|
2016-07-13 07:17:21 +02:00
|
|
|
chmode_table['S'].mode_class = ChmClass{CHM_D};
|
2008-04-08 19:29:19 +02:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_moddeinit(void)
|
|
|
|
{
|
|
|
|
chmode_table['S'].set_func = chm_nosuch;
|
|
|
|
chmode_table['S'].mode_type = 0;
|
2016-07-13 07:17:21 +02:00
|
|
|
chmode_table['S'].mode_class = ChmClass(0);
|
2008-04-08 19:29:19 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
chm_sslonly(struct Client *source_p, struct Channel *chptr,
|
|
|
|
int alevel, int parc, int *parn,
|
|
|
|
const char **parv, int *errors, int dir, char c, long mode_type)
|
|
|
|
{
|
|
|
|
int newparn = 0;
|
|
|
|
const char *newparv[] = { "$~z" };
|
|
|
|
|
|
|
|
if (MyClient(source_p))
|
|
|
|
chm_ban(source_p, chptr, alevel, 1, &newparn, newparv,
|
|
|
|
errors, dir, 'b', CHFL_BAN);
|
|
|
|
else
|
|
|
|
chm_nosuch(source_p, chptr, alevel, parc, parn, parv,
|
|
|
|
errors, dir, c, mode_type);
|
|
|
|
}
|