2007-01-24 22:40:21 -08:00
|
|
|
/*
|
|
|
|
* Server name extban type: bans all users using a certain server
|
|
|
|
* -- jilles
|
|
|
|
*/
|
|
|
|
|
2016-08-17 22:33:38 -07:00
|
|
|
namespace mode = ircd::chan::mode;
|
2016-08-16 20:01:20 -07:00
|
|
|
namespace ext = mode::ext;
|
2016-08-12 20:05:54 -07:00
|
|
|
using namespace ircd;
|
|
|
|
|
2016-03-09 01:29:41 -06:00
|
|
|
static const char extb_desc[] = "Server ($s) extban type";
|
|
|
|
|
2007-01-24 22:40:21 -08:00
|
|
|
static int _modinit(void);
|
|
|
|
static void _moddeinit(void);
|
2016-08-21 18:57:43 -07:00
|
|
|
static int eb_server(const char *data, client::client *client_p, chan::chan *chptr, mode::type);
|
2007-01-24 22:40:21 -08:00
|
|
|
|
2016-03-07 00:31:41 -06:00
|
|
|
DECLARE_MODULE_AV2(extb_server, _modinit, _moddeinit, NULL, NULL, NULL, NULL, NULL, extb_desc);
|
2007-01-24 22:40:21 -08:00
|
|
|
|
|
|
|
static int
|
|
|
|
_modinit(void)
|
|
|
|
{
|
2016-08-16 20:01:20 -07:00
|
|
|
ext::table['s'] = eb_server;
|
2007-01-24 22:40:21 -08:00
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_moddeinit(void)
|
|
|
|
{
|
2016-08-16 20:01:20 -07:00
|
|
|
ext::table['s'] = NULL;
|
2007-01-24 22:40:21 -08:00
|
|
|
}
|
|
|
|
|
2016-08-17 22:33:38 -07:00
|
|
|
static int
|
2016-08-21 18:57:43 -07:00
|
|
|
eb_server(const char *data, client::client *client_p, chan::chan *chptr, mode::type type)
|
2007-01-24 22:40:21 -08:00
|
|
|
{
|
2016-08-16 20:01:20 -07:00
|
|
|
using namespace ext;
|
2016-08-17 22:33:38 -07:00
|
|
|
using namespace mode;
|
2007-01-24 22:40:21 -08:00
|
|
|
|
|
|
|
/* This type is not safe for exceptions */
|
2016-08-17 22:33:38 -07:00
|
|
|
if (type == EXCEPTION || type == INVEX)
|
2016-08-16 20:01:20 -07:00
|
|
|
return INVALID;
|
2016-08-17 22:33:38 -07:00
|
|
|
|
2007-01-24 22:40:21 -08:00
|
|
|
if (data == NULL)
|
2016-08-16 20:01:20 -07:00
|
|
|
return INVALID;
|
2016-08-17 22:33:38 -07:00
|
|
|
|
|
|
|
return match(data, me.name)? MATCH : NOMATCH;
|
2007-01-24 22:40:21 -08:00
|
|
|
}
|