]> jfr.im git - irc/rqf/shadowircd.git/blame - extensions/extb_extgecos.c
Disallow mIRC italics in channel names when disable_fake_channels
[irc/rqf/shadowircd.git] / extensions / extb_extgecos.c
CommitLineData
212380e3 1/*
2 * Extended extban type: bans all users with matching nick!user@host#gecos.
3 * Requested by Lockwood.
4 * - nenolod
5 *
212380e3 6 */
7
8#include "stdinc.h"
9#include "modules.h"
10#include "client.h"
11#include "ircd.h"
12
13static int _modinit(void);
14static void _moddeinit(void);
15static int eb_extended(const char *data, struct Client *client_p, struct Channel *chptr, long mode_type);
16
17DECLARE_MODULE_AV1(extb_extended, _modinit, _moddeinit, NULL, NULL, NULL, "$Revision: 1339 $");
18
19static int
20_modinit(void)
21{
22 extban_table['x'] = eb_extended;
23
24 return 0;
25}
26
27static void
28_moddeinit(void)
29{
30 extban_table['x'] = NULL;
31}
32
33static int eb_extended(const char *data, struct Client *client_p,
34 struct Channel *chptr, long mode_type)
35{
36 char buf[BUFSIZE];
37 int ret;
38
39 (void)chptr;
40
41 if (data == NULL)
42 return EXTBAN_INVALID;
43
71f6ebfa 44 rb_snprintf(buf, BUFSIZE, "%s!%s@%s#%s",
212380e3 45 client_p->name, client_p->username, client_p->host, client_p->info);
46
47 ret = match(data, buf) ? EXTBAN_MATCH : EXTBAN_NOMATCH;
48
49 if (ret == EXTBAN_NOMATCH && IsDynSpoof(client_p))
50 {
71f6ebfa 51 rb_snprintf(buf, BUFSIZE, "%s!%s@%s#%s",
212380e3 52 client_p->name, client_p->username, client_p->orighost, client_p->info);
53
54 ret = match(data, buf) ? EXTBAN_MATCH : EXTBAN_NOMATCH;
55 }
56
57 return ret;
58}