X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_chanfilter.cpp;h=903aab33a8eeb2f5f2e724a0225a6188849152b1;hb=a0f7d012791d79b67b56b62415f7901d5e48870f;hp=ce23870041bf53b10e417e11de00b0b960b614c7;hpb=780dda83ba3857bc3c330d4b5d38bb251a9d879b;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_chanfilter.cpp b/src/modules/m_chanfilter.cpp index ce2387004..903aab33a 100644 --- a/src/modules/m_chanfilter.cpp +++ b/src/modules/m_chanfilter.cpp @@ -46,7 +46,7 @@ class ChanFilter : public ListModeBase bool ValidateParam(User* user, Channel* chan, std::string& word) CXX11_OVERRIDE { - if (word.length() > maxlen) + if (word.length() > maxlen) { user->WriteNumeric(Numerics::InvalidModeParameter(chan, this, word, "Word is too long for the spamfilter list")); return false; @@ -76,6 +76,7 @@ class ModuleChanFilter : public Module CheckExemption::EventProvider exemptionprov; ChanFilter cf; bool hidemask; + bool notifyuser; public: @@ -90,6 +91,7 @@ class ModuleChanFilter : public Module ConfigTag* tag = ServerInstance->Config->ConfValue("chanfilter"); hidemask = tag->getBool("hidemask"); cf.maxlen = tag->getUInt("maxlen", 35, 10, 100); + notifyuser = tag->getBool("notifyuser", true); cf.DoRehash(); } @@ -112,10 +114,16 @@ class ModuleChanFilter : public Module { if (InspIRCd::Match(details.text, i->mask)) { + if (!notifyuser) + { + details.echo_original = true; + return MOD_RES_DENY; + } + if (hidemask) user->WriteNumeric(ERR_CANNOTSENDTOCHAN, chan->name, "Cannot send to channel (your message contained a censored word)"); else - user->WriteNumeric(ERR_CANNOTSENDTOCHAN, chan->name, i->mask, "Cannot send to channel (your message contained a censored word)"); + user->WriteNumeric(ERR_CANNOTSENDTOCHAN, chan->name, "Cannot send to channel (your message contained a censored word: " + i->mask + ")"); return MOD_RES_DENY; } }