]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_messageflood.cpp
Minor spelling errors in m_spanningtree.so
[user/henk/code/inspircd.git] / src / modules / m_messageflood.cpp
index ff92fcaa394ac22031eef651707e6c35ef1bd194..9ff17924d1c38bbb154c4a959fa151824894a221 100644 (file)
@@ -126,11 +126,14 @@ class ModuleMsgFlood : public Module
        ModuleMsgFlood()
                : mf(this)
        {
-               if (!ServerInstance->Modes->AddMode(&mf))
-                       throw ModuleException("Could not add new modes!");
-               ServerInstance->Extensions.Register(&mf.ext);
+       }
+
+       void init()
+       {
+               ServerInstance->Modules->AddService(mf);
+               ServerInstance->Modules->AddService(mf.ext);
                Implementation eventlist[] = { I_OnUserPreNotice, I_OnUserPreMessage };
-               ServerInstance->Modules->Attach(eventlist, this, 2);
+               ServerInstance->Modules->Attach(eventlist, this, sizeof(eventlist)/sizeof(Implementation));
        }
 
        ModResult ProcessMessages(User* user,Channel* dest, const std::string &text)
@@ -185,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()