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
23 Implementation eventlist[] = { I_OnUserPreMessage, I_OnUserPreNotice, I_On005Numeric };
24 ServerInstance->Modules->Attach(eventlist, this, 3);
27 virtual ~ModuleQuietBan()
31 virtual Version GetVersion()
33 return Version("Implements extban +b m: - mute bans",VF_COMMON|VF_VENDOR);
36 virtual ModResult OnUserPreMessage(User *user, void *dest, int target_type, std::string &text, char status, CUList &exempt_list)
38 if (!IS_LOCAL(user) || target_type != TYPE_CHANNEL)
39 return MOD_RES_PASSTHRU;
41 Channel* chan = static_cast<Channel*>(dest);
42 if (chan->GetExtBanStatus(user, 'm') == MOD_RES_DENY && chan->GetPrefixValue(user) < VOICE_VALUE)
44 user->WriteNumeric(404, "%s %s :Cannot send to channel (you're muted)", user->nick.c_str(), chan->name.c_str());
48 return MOD_RES_PASSTHRU;
51 virtual ModResult OnUserPreNotice(User *user, void *dest, int target_type, std::string &text, char status, CUList &exempt_list)
53 return OnUserPreMessage(user, dest, target_type, text, status, exempt_list);
56 virtual void On005Numeric(std::string &output)
58 ServerInstance->AddExtBanChar('m');
63 MODULE_INIT(ModuleQuietBan)