X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_chanfilter.cpp;h=6131ab9166d2471f050a8cfaa8c960a148fb8c2a;hb=4e3d655dff6f8a5aed626475fbf19c2a7119c20b;hp=ce6a31a34c81dc17505d611c3e4487bf62ea84c4;hpb=124c17e14134a4999afc1a5e981ab7c75b3694b9;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_chanfilter.cpp b/src/modules/m_chanfilter.cpp index ce6a31a34..6131ab916 100644 --- a/src/modules/m_chanfilter.cpp +++ b/src/modules/m_chanfilter.cpp @@ -27,14 +27,6 @@ #include "listmode.h" #include "modules/exemption.h" -enum -{ - // InspIRCd-specific. - ERR_ALREADYCHANFILTERED = 937, - ERR_NOSUCHCHANFILTER = 938, - ERR_CHANFILTERFULL = 939 -}; - /** Handles channel mode +g */ class ChanFilter : public ListModeBase @@ -42,33 +34,22 @@ class ChanFilter : public ListModeBase public: unsigned long maxlen; - ChanFilter(Module* Creator) : ListModeBase(Creator, "filter", 'g', "End of channel spamfilter list", 941, 940, false, "chanfilter") { } + ChanFilter(Module* Creator) + : ListModeBase(Creator, "filter", 'g', "End of channel spamfilter list", 941, 940, false) + { + syntax = ""; + } bool ValidateParam(User* user, Channel* chan, std::string& word) CXX11_OVERRIDE { if (word.length() > maxlen) { - user->WriteNumeric(Numerics::InvalidModeParameter(chan, this, word, "Word is too long for the spamfilter list")); + user->WriteNumeric(Numerics::InvalidModeParameter(chan, this, word, "Word is too long for the spamfilter list.")); return false; } return true; } - - void TellListTooLong(User* user, Channel* chan, std::string& word) CXX11_OVERRIDE - { - user->WriteNumeric(ERR_CHANFILTERFULL, chan->name, word, "Channel spamfilter list is full"); - } - - void TellAlreadyOnList(User* user, Channel* chan, std::string& word) CXX11_OVERRIDE - { - user->WriteNumeric(ERR_ALREADYCHANFILTERED, chan->name, InspIRCd::Format("The word %s is already on the spamfilter list", word.c_str())); - } - - void TellNotSet(User* user, Channel* chan, std::string& word) CXX11_OVERRIDE - { - user->WriteNumeric(ERR_NOSUCHCHANFILTER, chan->name, "No such spamfilter word is set"); - } }; class ModuleChanFilter : public Module @@ -90,7 +71,7 @@ class ModuleChanFilter : public Module { ConfigTag* tag = ServerInstance->Config->ConfValue("chanfilter"); hidemask = tag->getBool("hidemask"); - cf.maxlen = tag->getUInt("maxlen", 35, 10, 100); + cf.maxlen = tag->getUInt("maxlen", 35, 10, ModeParser::MODE_PARAM_MAX); notifyuser = tag->getBool("notifyuser", true); cf.DoRehash(); } @@ -116,7 +97,7 @@ class ModuleChanFilter : public Module { if (!notifyuser) { - details.echooriginal = true; + details.echo_original = true; return MOD_RES_DENY; }