]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_muteban.cpp
Use SQUERY instead of PRIVMSG in alias/passforward config.
[user/henk/code/inspircd.git] / src / modules / m_muteban.cpp
index 045666f8972ba245b3b9aa75cab7472a946b3acb..61d592b2b9dba45bea8d60905e0f7aa247b1d339 100644 (file)
 
 class ModuleQuietBan : public Module
 {
+ private:
+       bool notifyuser;
+
  public:
+       void ReadConfig(ConfigStatus& status) CXX11_OVERRIDE
+       {
+               ConfigTag* tag = ServerInstance->Config->ConfValue("muteban");
+               notifyuser = tag->getBool("notifyuser", true);
+       }
+
        Version GetVersion() CXX11_OVERRIDE
        {
                return Version("Implements extban +b m: - mute bans",VF_OPTCOMMON|VF_VENDOR);
@@ -36,6 +45,12 @@ class ModuleQuietBan : public Module
                Channel* chan = target.Get<Channel>();
                if (chan->GetExtBanStatus(user, 'm') == MOD_RES_DENY && chan->GetPrefixValue(user) < VOICE_VALUE)
                {
+                       if (!notifyuser)
+                       {
+                               details.echo_original = true;
+                               return MOD_RES_DENY;
+                       }
+
                        user->WriteNumeric(ERR_CANNOTSENDTOCHAN, chan->name, "Cannot send to channel (you're muted)");
                        return MOD_RES_DENY;
                }