Clean.
[seven-1.x.git] / modules / m_exemptflood.c
blob06bf9573f0229078912eacbaafae8cfae690cabf
1 /*
2 * ircd-seven: A slightly useful ircd.
3 * m_exemptflood.c: Allow an oper or service to set a given user exempt from flood protection
5 * Copyright (C) 1990 Jarkko Oikarinen and University of Oulu, Co Center
6 * Copyright (C) 1996-2002 Hybrid Development Team
7 * Copyright (C) 2002-2006 ircd-ratbox development team
8 * Copyright (C) 2006 ircd-seven development team
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
23 * USA
25 * $Id: $
28 #include "stdinc.h"
29 #include "client.h"
30 #include "modules.h"
31 #include "send.h"
32 #include "numeric.h"
34 static int me_exemptflood(struct Client *, struct Client *, int, const char **);
36 struct Message exemptflood_msgtab = {
37 "EXEMPTFLOOD", 0, 0, 0, MFLG_SLOW,
38 { mg_unreg, mg_not_oper, mg_ignore, mg_ignore, {me_exemptflood, 1}, mg_ignore}
41 mapi_clist_av1 exemptflood_clist[] = { &exemptflood_msgtab, NULL };
43 DECLARE_MODULE_AV1(exemptflood, NULL, NULL, exemptflood_clist, NULL, NULL, "$Revision: $");
45 static int
46 me_exemptflood(struct Client *client_p, struct Client *source_p, int parc, const char *parv[])
48 struct Client *target_p;
50 target_p = find_named_person(parv[1]);
51 if(target_p == NULL)
53 sendto_one_numeric(source_p, ERR_NOSUCHNICK, form_str(ERR_NOSUCHNICK), parv[1]);
54 return 0;
57 if(!MyClient(target_p))
58 return 0;
60 SetExemptFlood(target_p);
62 return 0;