1 /* +------------------------------------+
2 * | Inspire Internet Relay Chat Daemon |
3 * +------------------------------------+
5 * InspIRCd: (C) 2002-2009 InspIRCd Development Team
6 * See: http://wiki.inspircd.org/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("$Id$",VF_COMMON|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)->GetExtBanStatus(user, 'm') < 0)
46 user->WriteNumeric(404, "%s %s :Cannot send to channel (you're muted)",user->nick.c_str(), ((Channel *)dest)->name.c_str());
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)->GetExtBanStatus(user, 'm') < 0)
63 user->WriteNumeric(404, "%s %s :Cannot send to channel (you're muted)",user->nick.c_str(), ((Channel *)dest)->name.c_str());
71 virtual void On005Numeric(std::string &output)
73 ServerInstance->AddExtBanChar('m');
78 MODULE_INIT(ModuleQuietBan)