2008-04-08 19:40:41 +02:00
|
|
|
/*
|
|
|
|
* Treat cmode +-O as +-iI $o.
|
|
|
|
*/
|
|
|
|
|
2016-08-17 05:01:20 +02:00
|
|
|
using namespace ircd::chan::mode;
|
2016-08-13 05:05:54 +02:00
|
|
|
using namespace ircd;
|
|
|
|
|
2016-03-09 08:29:41 +01:00
|
|
|
static const char chm_operonly_compat[] =
|
|
|
|
"Adds an emulated channel mode +O which is converted into mode +i and +I $o";
|
|
|
|
|
2008-04-08 19:40:41 +02:00
|
|
|
static int _modinit(void);
|
|
|
|
static void _moddeinit(void);
|
2016-08-22 03:57:43 +02:00
|
|
|
static void chm_operonly(client::client *source_p, chan::chan *chptr,
|
2008-04-08 19:40:41 +02:00
|
|
|
int alevel, int parc, int *parn,
|
2016-08-17 05:01:20 +02:00
|
|
|
const char **parv, int *errors, int dir, char c, type type);
|
2008-04-08 19:40:41 +02:00
|
|
|
|
2016-03-07 06:48:27 +01:00
|
|
|
DECLARE_MODULE_AV2(chm_operonly_compat, _modinit, _moddeinit, NULL, NULL, NULL, NULL, NULL, chm_operonly_compat);
|
2008-04-08 19:40:41 +02:00
|
|
|
|
|
|
|
static int
|
|
|
|
_modinit(void)
|
|
|
|
{
|
2016-08-17 05:01:20 +02:00
|
|
|
table['O'].type = type(0);
|
|
|
|
table['O'].category = category::D;
|
|
|
|
table['O'].set_func = chm_operonly;
|
2008-04-08 19:40:41 +02:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_moddeinit(void)
|
|
|
|
{
|
2016-08-17 05:01:20 +02:00
|
|
|
table['O'].type = type(0);
|
|
|
|
table['O'].category = category::D;
|
|
|
|
table['O'].set_func = functor::nosuch;
|
2008-04-08 19:40:41 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2016-08-22 03:57:43 +02:00
|
|
|
chm_operonly(client::client *source_p, chan::chan *chptr,
|
2008-04-08 19:40:41 +02:00
|
|
|
int alevel, int parc, int *parn,
|
2016-08-17 05:01:20 +02:00
|
|
|
const char **parv, int *errors, int dir, char c, type type)
|
2008-04-08 19:40:41 +02:00
|
|
|
{
|
|
|
|
int newparn = 0;
|
|
|
|
const char *newparv[] = { "$o" };
|
|
|
|
|
2016-08-17 05:01:20 +02:00
|
|
|
if (MyClient(source_p))
|
|
|
|
{
|
|
|
|
functor::simple(source_p, chptr, alevel, parc, parn, parv, errors, dir, 'i', INVITEONLY);
|
|
|
|
functor::ban(source_p, chptr, alevel, 1, &newparn, newparv, errors, dir, 'I', INVEX);
|
2008-04-08 19:40:41 +02:00
|
|
|
} else
|
2016-08-17 05:01:20 +02:00
|
|
|
functor::nosuch(source_p, chptr, alevel, parc, parn, parv, errors, dir, c, type);
|
2008-04-08 19:40:41 +02:00
|
|
|
}
|