]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_chanfilter.cpp
Rename the spanningtree module header to server.
[user/henk/code/inspircd.git] / src / modules / m_chanfilter.cpp
index a7bc215570c221e54e6419ff2a623d55b8d99c33..133c5180dd10338730378e333d20b0e0438053fb 100644 (file)
@@ -25,6 +25,7 @@
 
 #include "inspircd.h"
 #include "listmode.h"
+#include "modules/exemption.h"
 
 /** Handles channel mode +g
  */
@@ -33,8 +34,7 @@ class ChanFilter : public ListModeBase
  public:
        ChanFilter(Module* Creator) : ListModeBase(Creator, "filter", 'g', "End of channel spamfilter list", 941, 940, false, "chanfilter") { }
 
-       bool ValidateParam(User* user, Channel* chan, std::string &word)
-       {
+       bool ValidateParam(User* user, Channel* chan, std::string& word) CXX11_OVERRIDE {
                if (word.length() > 35)
                {
                        user->WriteNumeric(935, chan->name, word, "%word is too long for censor list");
@@ -44,17 +44,17 @@ class ChanFilter : public ListModeBase
                return true;
        }
 
-       void TellListTooLong(User* user, Channel* chan, std::string &word)
+       void TellListTooLong(User* user, Channel* chan, std::string& word) CXX11_OVERRIDE
        {
                user->WriteNumeric(939, chan->name, word, "Channel spamfilter list is full");
        }
 
-       void TellAlreadyOnList(User* user, Channel* chan, std::string &word)
+       void TellAlreadyOnList(User* user, Channel* chan, std::string& word) CXX11_OVERRIDE
        {
                user->WriteNumeric(937, 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)
+       void TellNotSet(User* user, Channel* chan, std::string& word) CXX11_OVERRIDE
        {
                user->WriteNumeric(938, chan->name, "No such spamfilter word is set");
        }
@@ -62,13 +62,15 @@ class ChanFilter : public ListModeBase
 
 class ModuleChanFilter : public Module
 {
+       CheckExemption::EventProvider exemptionprov;
        ChanFilter cf;
        bool hidemask;
 
  public:
 
        ModuleChanFilter()
-               : cf(this)
+               : exemptionprov(this)
+               , cf(this)
        {
        }
 
@@ -84,7 +86,7 @@ class ModuleChanFilter : public Module
                        return MOD_RES_PASSTHRU;
 
                Channel* chan = static_cast<Channel*>(dest);
-               ModResult res = ServerInstance->OnCheckExemption(user,chan,"filter");
+               ModResult res = CheckExemption::Call(exemptionprov, user, chan, "filter");
 
                if (!IS_LOCAL(user) || res == MOD_RES_ALLOW)
                        return MOD_RES_PASSTHRU;