X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_messageflood.cpp;h=ef7bf9d5266b2cf005c91647d95831fdeaa5c1e1;hb=19cc8380fb9060add68852e40846b10e4d1f18f5;hp=86296094b3151af2c81828a5b32c4bbaa6018747;hpb=3624c137a6db85eaab0372550c9dca79d6d21e55;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_messageflood.cpp b/src/modules/m_messageflood.cpp index 86296094b..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)