]> jfr.im git - solanum.git/blame - extensions/extb_hostmask.c
extensions/umode_hide_idle_time: mask times for hidden sources (#373)
[solanum.git] / extensions / extb_hostmask.c
CommitLineData
e2a9fa9c
AC
1/*
2 * Hostmask extban type: bans all users matching a given hostmask, used for stacked extbans
3 * -- kaniini
4 */
5
6#include "stdinc.h"
7#include "modules.h"
8#include "client.h"
9#include "ircd.h"
e2a9fa9c 10
eeabf33a
EM
11static const char extb_desc[] = "Hostmask ($m) extban type";
12
e2a9fa9c
AC
13static int _modinit(void);
14static void _moddeinit(void);
15static int eb_hostmask(const char *data, struct Client *client_p, struct Channel *chptr, long mode_type);
16
c81afd15 17DECLARE_MODULE_AV2(extb_hostmask, _modinit, _moddeinit, NULL, NULL, NULL, NULL, NULL, extb_desc);
e2a9fa9c
AC
18
19static int
20_modinit(void)
21{
22 extban_table['m'] = eb_hostmask;
23 return 0;
24}
25
26static void
27_moddeinit(void)
28{
29 extban_table['m'] = NULL;
30}
31
32static int
33eb_hostmask(const char *banstr, struct Client *client_p, struct Channel *chptr, long mode_type)
34{
a7bd528f
EK
35 if (banstr == NULL)
36 return EXTBAN_INVALID;
a7d4a0ab 37 return client_matches_mask(client_p, banstr) ? EXTBAN_MATCH : EXTBAN_NOMATCH;
e2a9fa9c 38}