2 * InspIRCd -- Internet Relay Chat Daemon
4 * Copyright (C) 2009 Daniel De Graaf <danieldg@inspircd.org>
5 * Copyright (C) 2008 Robin Burchell <robin+git@viroteck.net>
7 * This file is part of InspIRCd. InspIRCd is free software: you can
8 * redistribute it and/or modify it under the terms of the GNU General Public
9 * License as published by the Free Software Foundation, version 2.
11 * This program is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
13 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
23 class ModuleQuietBan : public Module
29 void ReadConfig(ConfigStatus& status) CXX11_OVERRIDE
31 ConfigTag* tag = ServerInstance->Config->ConfValue("muteban");
32 notifyuser = tag->getBool("notifyuser", true);
35 Version GetVersion() CXX11_OVERRIDE
37 return Version("Implements extban +b m: - mute bans",VF_OPTCOMMON|VF_VENDOR);
40 ModResult OnUserPreMessage(User* user, const MessageTarget& target, MessageDetails& details) CXX11_OVERRIDE
42 if (!IS_LOCAL(user) || target.type != MessageTarget::TYPE_CHANNEL)
43 return MOD_RES_PASSTHRU;
45 Channel* chan = target.Get<Channel>();
46 if (chan->GetExtBanStatus(user, 'm') == MOD_RES_DENY && chan->GetPrefixValue(user) < VOICE_VALUE)
50 details.echo_original = true;
54 user->WriteNumeric(ERR_CANNOTSENDTOCHAN, chan->name, "Cannot send to channel (you're muted)");
58 return MOD_RES_PASSTHRU;
61 void On005Numeric(std::map<std::string, std::string>& tokens) CXX11_OVERRIDE
63 tokens["EXTBAN"].push_back('m');
67 MODULE_INIT(ModuleQuietBan)