]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_nickflood.cpp
Change to Duration for second param
[user/henk/code/inspircd.git] / src / modules / m_nickflood.cpp
index 748ecf1d5a06313ffb866bada8589599347b40ff..7f67b8d08f9ffc6a5cbc69bb62b39542782fa860 100644 (file)
@@ -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