2007-01-25 06:40:21 +00:00
|
|
|
/*
|
|
|
|
* Channel extban type: matches users who are in a certain public channel
|
|
|
|
* -- jilles
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "stdinc.h"
|
|
|
|
#include "modules.h"
|
|
|
|
#include "client.h"
|
|
|
|
#include "channel.h"
|
|
|
|
#include "hash.h"
|
|
|
|
#include "ircd.h"
|
|
|
|
|
|
|
|
static int _modinit(void);
|
|
|
|
static void _moddeinit(void);
|
|
|
|
static int eb_channel(const char *data, struct Client *client_p, struct Channel *chptr, long mode_type);
|
|
|
|
|
|
|
|
DECLARE_MODULE_AV1(extb_channel, _modinit, _moddeinit, NULL, NULL, NULL, "$Revision: 1723 $");
|
|
|
|
|
|
|
|
static int
|
|
|
|
_modinit(void)
|
|
|
|
{
|
2014-08-03 17:38:55 +00:00
|
|
|
extban_table['c'] = eb_channel;
|
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['c'] = NULL;
|
2007-01-25 06:40:21 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
static int eb_channel(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
|
|
|
struct Channel *chptr2;
|
|
|
|
|
|
|
|
(void)chptr;
|
|
|
|
(void)mode_type;
|
|
|
|
if (data == NULL)
|
|
|
|
return EXTBAN_INVALID;
|
|
|
|
chptr2 = find_channel(data);
|
|
|
|
if (chptr2 == NULL)
|
|
|
|
return EXTBAN_INVALID;
|
|
|
|
/* require consistent target */
|
|
|
|
if (chptr->chname[0] == '#' && data[0] == '&')
|
|
|
|
return EXTBAN_INVALID;
|
|
|
|
/* privacy! don't allow +s/+p channels to influence another channel */
|
|
|
|
if (!PubChannel(chptr2))
|
|
|
|
return EXTBAN_INVALID;
|
|
|
|
return IsMember(client_p, chptr2) ? EXTBAN_MATCH : EXTBAN_NOMATCH;
|
2007-01-25 06:40:21 +00:00
|
|
|
}
|