X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fmodules%2Fm_nickflood.cpp;h=a267cd4043d448031046c3cd29db7e297bad9c91;hb=b43fc66c17c2bef6dca66a966676b8128d5774ee;hp=733b55b64046bbe9f039b4b588a1b12619a530cc;hpb=9336468f5bfa60318cb57db5126047147b7a21cb;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/modules/m_nickflood.cpp b/src/modules/m_nickflood.cpp index 733b55b64..a267cd404 100644 --- a/src/modules/m_nickflood.cpp +++ b/src/modules/m_nickflood.cpp @@ -17,7 +17,7 @@ /** Holds settings and state associated with channel mode +F */ -class nickfloodsettings : public classbase +class nickfloodsettings { public: int secs; @@ -89,7 +89,7 @@ class NickFlood : public ModeHandler { public: SimpleExtItem ext; - NickFlood(Module* Creator) : ModeHandler(Creator, 'F', PARAM_SETONLY, MODETYPE_CHANNEL), + NickFlood(Module* Creator) : ModeHandler(Creator, "nickflood", 'F', PARAM_SETONLY, MODETYPE_CHANNEL), ext("nickflood", Creator) { } ModePair ModeSet(User* source, User* dest, Channel* channel, const std::string ¶meter) @@ -200,7 +200,7 @@ class ModuleNickFlood : public Module { if (!ServerInstance->Modes->AddMode(&nf)) throw ModuleException("Could not add new modes!"); - Extensible::Register(&nf.ext); + ServerInstance->Extensions.Register(&nf.ext); Implementation eventlist[] = { I_OnUserPreNick, I_OnUserPostNick }; ServerInstance->Modules->Attach(eventlist, this, 2); } @@ -213,11 +213,13 @@ class ModuleNickFlood : public Module for (UCListIter i = user->chans.begin(); i != user->chans.end(); i++) { Channel *channel = *i; + ModResult res; nickfloodsettings *f = nf.ext.get(channel); if (f) { - if (CHANOPS_EXEMPT('F') && channel->GetPrefixValue(user) == OP_VALUE) + FIRST_MOD_RESULT(OnChannelRestrictionApply, res, (user,channel,"nickflood")); + if (res == MOD_RES_ALLOW) continue; if (f->islocked()) @@ -250,11 +252,13 @@ class ModuleNickFlood : public Module for (UCListIter i = user->chans.begin(); i != user->chans.end(); ++i) { Channel *channel = *i; + ModResult res; nickfloodsettings *f = nf.ext.get(channel); if (f) { - if (CHANOPS_EXEMPT('F') && channel->GetPrefixValue(user) == OP_VALUE) + FIRST_MOD_RESULT(OnChannelRestrictionApply, res, (user,channel,"nickflood")); + if (res == MOD_RES_ALLOW) return; /* moved this here to avoid incrementing the counter for nick