More RCS keyword removal...
[seven-1.x.git] / extensions / extb_extgecos.c
blob5648b38e72f1c38de6147ae6b407716989d993a0
1 /* {{{ irc-seven: Cows like it.
3 * Copyright (C) 2006 William Pitcock.
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to:
18 * Free Software Foundation, Inc.
19 * 51 Franklin St - Fifth Floor
20 * Boston, MA 02110-1301
21 * USA
23 * }}} */
25 #include "stdinc.h"
26 #include "modules.h"
27 #include "client.h"
28 #include "ircd.h"
30 static int _modinit (void);
31 static void _moddeinit (void);
32 static int eb_extended (const char *, struct Client *, struct Channel *, long);
34 /* {{{ DECLARE_MODULE_AV1(...) */
35 DECLARE_MODULE_AV1
37 extb_extended,
38 _modinit,
39 _moddeinit,
40 NULL,
41 NULL,
42 NULL,
43 "1.1"
45 /* }}} */
47 /* {{{ static int _modinit() */
48 static int
49 _modinit (void)
51 extban_table['x'] = eb_extended;
52 return 0;
54 /* }}} */
56 /* {{{ static void _moddeinit() */
57 static void
58 _moddeinit (void)
60 extban_table['x'] = NULL;
62 /* }}} */
64 /* {{{ static int eb_extended() */
65 static int eb_extended (const char *data, struct Client *client_p,
66 struct Channel *chptr, long mode_type)
68 char buf[BUFSIZE];
69 int ret;
71 if (!data)
72 return EXTBAN_INVALID;
74 ircsnprintf(buf, BUFSIZE, "%s!%s@%s#%s", client_p->name, client_p->username,
75 client_p->host, client_p->info);
77 ret = match(data, buf) ? EXTBAN_MATCH : EXTBAN_NOMATCH;
78 if (ret == EXTBAN_NOMATCH && IsDynSpoof(client_p))
80 ircsnprintf(buf, BUFSIZE, "%s!%s@%s#%s", client_p->name,
81 client_p->username, client_p->orighost, client_p->info);
83 ret = match(data, buf) ? EXTBAN_MATCH : EXTBAN_NOMATCH;
86 return ret;
88 /* }}} */
91 * vim: ts=8 sw=8 noet fdm=marker tw=80