]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_nickflood.cpp
Fix access checks on chanprotect preventing use of SAMODE
[user/henk/code/inspircd.git] / src / modules / m_nickflood.cpp
index 898c7358dec9f86cf9c1d646a7bbc8df73e9f3cd..5a59814d4b7fd1c04511649962fc71c212be7db3 100644 (file)
@@ -91,7 +91,7 @@ class NickFlood : public ModeHandler
 {
  public:
        SimpleExtItem<nickfloodsettings> ext;
-       NickFlood(InspIRCd* Instance, Module* Creator) : ModeHandler(Instance, Creator, 'F', 1, 0, false, MODETYPE_CHANNEL, false),
+       NickFlood(InspIRCd* Instance, Module* Creator) : ModeHandler(Creator, 'F', PARAM_SETONLY, MODETYPE_CHANNEL),
                ext("nickflood", Creator) { }
 
        ModePair ModeSet(User* source, User* dest, Channel* channel, const std::string &parameter)
@@ -214,12 +214,12 @@ class ModuleNickFlood : public Module
 
                for (UCListIter i = user->chans.begin(); i != user->chans.end(); i++)
                {
-                       Channel *channel = i->first;
+                       Channel *channel = *i;
 
                        nickfloodsettings *f = nf.ext.get(channel);
                        if (f)
                        {
-                               if (CHANOPS_EXEMPT(ServerInstance, 'F') && channel->GetStatus(user) == STATUS_OP)
+                               if (CHANOPS_EXEMPT(ServerInstance, 'F') && channel->GetPrefixValue(user) == OP_VALUE)
                                        continue;
 
                                if (f->islocked())
@@ -251,12 +251,12 @@ class ModuleNickFlood : public Module
 
                for (UCListIter i = user->chans.begin(); i != user->chans.end(); ++i)
                {
-                       Channel *channel = i->first;
+                       Channel *channel = *i;
 
                        nickfloodsettings *f = nf.ext.get(channel);
                        if (f)
                        {
-                               if (CHANOPS_EXEMPT(ServerInstance, 'F') && channel->GetStatus(user) == STATUS_OP)
+                               if (CHANOPS_EXEMPT(ServerInstance, 'F') && channel->GetPrefixValue(user) == OP_VALUE)
                                        return;
                                
                                /* moved this here to avoid incrementing the counter for nick