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;
CheckExemption::EventProvider exemptionprov;
ChanFilter cf;
bool hidemask;
+ bool notifyuser;
public:
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();
}
{
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;
}
}