1 /* +------------------------------------+
2 * | Inspire Internet Relay Chat Daemon |
3 * +------------------------------------+
5 * InspIRCd: (C) 2002-2008 InspIRCd Development Team
6 * See: http://www.inspircd.org/wiki/index.php/Credits
8 * This program is free but copyrighted software; see
9 * the file COPYING for details.
11 * ---------------------------------------------------
16 /* $ModDesc: Implements extban +b m: - mute bans */
18 class ModuleQuietBan : public Module
22 ModuleQuietBan(InspIRCd* Me) : Module(Me)
24 Implementation eventlist[] = { I_OnUserPreMessage, I_OnUserPreNotice, I_On005Numeric };
25 ServerInstance->Modules->Attach(eventlist, this, 3);
28 virtual ~ModuleQuietBan()
32 virtual Version GetVersion()
34 return Version(1,2,0,0,VF_VENDOR,API_VERSION);
37 virtual int OnUserPreMessage(User *user, void *dest, int target_type, std::string &text, char status, CUList &exempt_list)
42 if (target_type == TYPE_CHANNEL)
44 if (((Channel *)dest)->IsExtBanned(user, 'm'))
46 user->WriteServ("NOTICE "+std::string(user->nick)+" :*** Cannot send to " + ((Channel *)dest)->name + ", as you are muted");
54 virtual int OnUserPreNotice(User *user, void *dest, int target_type, std::string &text, char status, CUList &exempt_list)
59 if (target_type == TYPE_CHANNEL)
61 if (((Channel *)dest)->IsExtBanned(user, 'm'))
63 user->WriteServ("NOTICE "+std::string(user->nick)+" :*** Cannot send to " + ((Channel *)dest)->name + ", as you are muted");
71 virtual void On005Numeric(std::string &output)
73 ServerInstance->AddExtBanChar('m');
78 MODULE_INIT(ModuleQuietBan)