X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_messageflood.cpp;h=ef7bf9d5266b2cf005c91647d95831fdeaa5c1e1;hb=67de413cad88194972d55a8ff88464370890c5a9;hp=65c3354a9212b5ec624639995bf0d738bdcbd96d;hpb=f00ac52c5d593fcb761fc316b2582bb06158035c;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_messageflood.cpp b/src/modules/m_messageflood.cpp index 65c3354a9..ef7bf9d52 100644 --- a/src/modules/m_messageflood.cpp +++ b/src/modules/m_messageflood.cpp @@ -25,8 +25,6 @@ #include "inspircd.h" -/* $ModDesc: Provides channel mode +f (message flood protection) */ - /** Holds flood settings and state for mode +f */ class floodsettings @@ -102,16 +100,14 @@ class MsgFlood : public ModeHandler ext.set(channel, new floodsettings(ban, nsecs, nlines)); parameter = std::string(ban ? "*" : "") + ConvToStr(nlines) + ":" + ConvToStr(nsecs); - channel->SetModeParam('f', parameter); return MODEACTION_ALLOW; } else { - if (!channel->IsModeSet('f')) + if (!channel->IsModeSet(this)) return MODEACTION_DENY; ext.unset(channel); - channel->SetModeParam('f', ""); return MODEACTION_ALLOW; } } @@ -132,12 +128,11 @@ class ModuleMsgFlood : public Module { ServerInstance->Modules->AddService(mf); ServerInstance->Modules->AddService(mf.ext); - ServerInstance->Modules->Attach(I_OnUserPreMessage, this); } ModResult ProcessMessages(User* user,Channel* dest, const std::string &text) { - if ((!IS_LOCAL(user)) || !dest->IsModeSet('f')) + if ((!IS_LOCAL(user)) || !dest->IsModeSet(mf)) return MOD_RES_PASSTHRU; if (ServerInstance->OnCheckExemption(user,dest,"flood") == MOD_RES_ALLOW) @@ -156,7 +151,7 @@ class ModuleMsgFlood : public Module parameters.push_back(dest->name); parameters.push_back("+b"); parameters.push_back("*!*@" + user->dhost); - ServerInstance->SendGlobalMode(parameters, ServerInstance->FakeClient); + ServerInstance->Modes->Process(parameters, ServerInstance->FakeClient); } const std::string kickMessage = "Channel flood triggered (limit is " + ConvToStr(f->lines) +