X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_messageflood.cpp;h=9ff17924d1c38bbb154c4a959fa151824894a221;hb=a5d110282a864fd2e91b51ce360a977cd0643657;hp=a2fdc115ef9b65bc0c35fc946b8035f4ec1da267;hpb=ac7defcd3e52695dcf5e5150e9fe3e1624205e64;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_messageflood.cpp b/src/modules/m_messageflood.cpp index a2fdc115e..9ff17924d 100644 --- a/src/modules/m_messageflood.cpp +++ b/src/modules/m_messageflood.cpp @@ -130,11 +130,10 @@ 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, 2); + ServerInstance->Modules->Attach(eventlist, this, sizeof(eventlist)/sizeof(Implementation)); } ModResult ProcessMessages(User* user,Channel* dest, const std::string &text) @@ -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()