unrealircd

- supernets unrealircd source & configuration
git clone git://git.acid.vegas/unrealircd.git
Log | Files | Refs | Archive | README | LICENSE

quiet.c (1835B)

      1 /*
      2  * Extended ban that affects messages/notices only (+b ~q)
      3  * (C) Copyright 2003-.. Bram Matthys (Syzop) and the UnrealIRCd team
      4  *
      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 1, or (at your option)
      8  * any later version.
      9  *
     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.
     14  *
     15  * You should have received a copy of the GNU General Public License
     16  * along with this program; if not, write to the Free Software
     17  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
     18  */
     19 #include "unrealircd.h"
     20 
     21 ModuleHeader MOD_HEADER
     22 = {
     23 	"extbans/quiet",
     24 	"4.2",
     25 	"ExtBan ~q - prevent messages only (quiet)",
     26 	"UnrealIRCd Team",
     27 	"unrealircd-6",
     28 };
     29 
     30 /* Forward declarations */
     31 int extban_quiet_is_banned(BanContext *b);
     32 
     33 /** Called upon module init */
     34 MOD_INIT()
     35 {
     36 	ExtbanInfo req;
     37 	
     38 	memset(&req, 0, sizeof(req));
     39 	req.letter = 'q';
     40 	req.name = "quiet";
     41 	req.is_ok = extban_is_ok_nuh_extban;
     42 	req.conv_param = extban_conv_param_nuh_or_extban;
     43 	req.is_banned = extban_quiet_is_banned;
     44 	req.is_banned_events = BANCHK_MSG;
     45 	req.options = EXTBOPT_ACTMODIFIER;
     46 	if (!ExtbanAdd(modinfo->handle, req))
     47 	{
     48 		config_error("could not register extended ban type");
     49 		return MOD_FAILED;
     50 	}
     51 
     52 	MARK_AS_OFFICIAL_MODULE(modinfo);
     53 	
     54 	return MOD_SUCCESS;
     55 }
     56 
     57 /** Called upon module load */
     58 MOD_LOAD()
     59 {
     60 	return MOD_SUCCESS;
     61 }
     62 
     63 /** Called upon unload */
     64 MOD_UNLOAD()
     65 {
     66 	return MOD_SUCCESS;
     67 }
     68 
     69 /** This ban that affects messages/notices only */
     70 int extban_quiet_is_banned(BanContext *b)
     71 {
     72 	return ban_check_mask(b);
     73 }