X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_messageflood.cpp;h=9d2e0e681c3a828b03ba25dc45ee5023937b60a7;hb=4aa27e75af8da0a5bc2e35f931f0165339f5f289;hp=9d119b6c37cfc679e52315670acddb443ae7f70e;hpb=02497bfa999da26c19a92d8620c35bb97f1da711;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_messageflood.cpp b/src/modules/m_messageflood.cpp index 9d119b6c3..9d2e0e681 100644 --- a/src/modules/m_messageflood.cpp +++ b/src/modules/m_messageflood.cpp @@ -37,7 +37,10 @@ class floodsettings time_t reset; insp::flat_map counters; - floodsettings(bool a, int b, int c) : ban(a), secs(b), lines(c) + floodsettings(bool a, unsigned int b, unsigned int c) + : ban(a) + , secs(b) + , lines(c) { reset = ServerInstance->Time() + secs; } @@ -69,7 +72,7 @@ class MsgFlood : public ParamMode > { } - ModeAction OnSet(User* source, Channel* channel, std::string& parameter) + ModeAction OnSet(User* source, Channel* channel, std::string& parameter) CXX11_OVERRIDE { std::string::size_type colon = parameter.find(':'); if ((colon == std::string::npos) || (parameter.find('-') != std::string::npos)) @@ -124,8 +127,7 @@ class ModuleMsgFlood : public Module if ((!IS_LOCAL(user)) || !dest->IsModeSet(mf)) return MOD_RES_PASSTHRU; - ModResult res; - FIRST_MOD_RESULT_CUSTOM(exemptionprov, CheckExemption::EventListener, OnCheckExemption, res, (user, dest, "flood")); + ModResult res = CheckExemption::Call(exemptionprov, user, dest, "flood"); if (res == MOD_RES_ALLOW) return MOD_RES_PASSTHRU; @@ -139,7 +141,7 @@ class ModuleMsgFlood : public Module if (f->ban) { Modes::ChangeList changelist; - changelist.push_add(ServerInstance->Modes->FindMode('b', MODETYPE_CHANNEL), "*!*@" + user->dhost); + changelist.push_add(ServerInstance->Modes->FindMode('b', MODETYPE_CHANNEL), "*!*@" + user->GetDisplayedHost()); ServerInstance->Modes->Process(ServerInstance->FakeClient, dest, NULL, changelist); }