]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_messageflood.cpp
Update wiki links to use HTTPS and point to the correct pages.
[user/henk/code/inspircd.git] / src / modules / m_messageflood.cpp
index 27c2f88db88d19550a39faca2b9f3490f4a419e6..9ff17924d1c38bbb154c4a959fa151824894a221 100644 (file)
@@ -130,9 +130,8 @@ class ModuleMsgFlood : public Module
 
        void init()
        {
-               if (!ServerInstance->Modes->AddMode(&mf))
-                       throw ModuleException("Could not add new modes!");
-               ServerInstance->Extensions.Register(&mf.ext);
+               ServerInstance->Modules->AddService(mf);
+               ServerInstance->Modules->AddService(mf.ext);
                Implementation eventlist[] = { I_OnUserPreNotice, I_OnUserPreMessage };
                ServerInstance->Modules->Attach(eventlist, this, sizeof(eventlist)/sizeof(Implementation));
        }
@@ -189,8 +188,11 @@ class ModuleMsgFlood : public Module
                return MOD_RES_PASSTHRU;
        }
 
-       ~ModuleMsgFlood()
+       void Prioritize()
        {
+               // we want to be after all modules that might deny the message (e.g. m_muteban, m_noctcp, m_blockcolor, etc.)
+               ServerInstance->Modules->SetPriority(this, I_OnUserPreMessage, PRIORITY_LAST);
+               ServerInstance->Modules->SetPriority(this, I_OnUserPreNotice, PRIORITY_LAST);
        }
 
        Version GetVersion()