2007-01-25 06:40:21 +00:00
|
|
|
/*
|
|
|
|
* Server name extban type: bans all users using a certain server
|
|
|
|
* -- jilles
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "stdinc.h"
|
|
|
|
#include "modules.h"
|
|
|
|
#include "client.h"
|
|
|
|
#include "ircd.h"
|
|
|
|
|
|
|
|
static int _modinit(void);
|
|
|
|
static void _moddeinit(void);
|
|
|
|
static int eb_server(const char *data, struct Client *client_p, struct Channel *chptr, long mode_type);
|
|
|
|
|
|
|
|
DECLARE_MODULE_AV1(extb_server, _modinit, _moddeinit, NULL, NULL, NULL, "$Revision: 1299 $");
|
|
|
|
|
|
|
|
static int
|
|
|
|
_modinit(void)
|
|
|
|
{
|
2014-08-03 17:38:55 +00:00
|
|
|
extban_table['s'] = eb_server;
|
2007-01-25 06:40:21 +00:00
|
|
|
|
2014-08-03 17:38:55 +00:00
|
|
|
return 0;
|
2007-01-25 06:40:21 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_moddeinit(void)
|
|
|
|
{
|
2014-08-03 17:38:55 +00:00
|
|
|
extban_table['s'] = NULL;
|
2007-01-25 06:40:21 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static int eb_server(const char *data, struct Client *client_p,
|
2014-08-03 17:38:55 +00:00
|
|
|
struct Channel *chptr, long mode_type)
|
2007-01-25 06:40:21 +00:00
|
|
|
{
|
|
|
|
|
2014-08-03 17:38:55 +00:00
|
|
|
(void)chptr;
|
|
|
|
/* This type is not safe for exceptions */
|
|
|
|
if (mode_type == CHFL_EXCEPTION || mode_type == CHFL_INVEX)
|
|
|
|
return EXTBAN_INVALID;
|
|
|
|
if (data == NULL)
|
|
|
|
return EXTBAN_INVALID;
|
|
|
|
return match(data, me.name) ? EXTBAN_MATCH : EXTBAN_NOMATCH;
|
2007-01-25 06:40:21 +00:00
|
|
|
}
|