]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_messageflood.cpp
Fix various rline bugs, implement /stats R, and fix the issue where you get no error...
[user/henk/code/inspircd.git] / src / modules / m_messageflood.cpp
index b0065f0658bc49ce5161ae640e57c1adc6a033dd..21b432222fe81de7e7d58f5a8e53045c81ddfebf 100644 (file)
@@ -157,7 +157,7 @@ class MsgFlood : public ModeHandler
                                                }
                                                else
                                                {
-                                                       if (((nlines != f->lines) || (nsecs != f->secs)) && ((nsecs > 0) && (nlines > 0)) || (ban != f->ban))
+                                                       if ((((nlines != f->lines) || (nsecs != f->secs) || (ban != f->ban))) && (((nsecs > 0) && (nlines > 0))))
                                                        {
                                                                delete f;
                                                                floodsettings *fs = new floodsettings(ban,nsecs,nlines);
@@ -192,32 +192,32 @@ class MsgFlood : public ModeHandler
                                return MODEACTION_ALLOW;
                        }
                }
-               
+
                return MODEACTION_DENY;
        }
 };
 
 class ModuleMsgFlood : public Module
 {
-       
+
        MsgFlood* mf;
-       
+
  public:
+
        ModuleMsgFlood(InspIRCd* Me)
                : Module(Me)
        {
-               
+
                mf = new MsgFlood(ServerInstance);
                if (!ServerInstance->Modes->AddMode(mf))
                        throw ModuleException("Could not add new modes!");
                Implementation eventlist[] = { I_OnChannelDelete, I_OnUserPreNotice, I_OnUserPreMessage };
                ServerInstance->Modules->Attach(eventlist, this, 3);
        }
-       
+
        int ProcessMessages(User* user,Channel* dest, const std::string &text)
        {
-               if (!IS_LOCAL(user) || CHANOPS_EXEMPT(ServerInstance, 'f') && dest->GetStatus(user) == STATUS_OP)
+               if (!IS_LOCAL(user) || (CHANOPS_EXEMPT(ServerInstance, 'f') && dest->GetStatus(user) == STATUS_OP))
                {
                        return 0;
                }
@@ -252,7 +252,7 @@ class ModuleMsgFlood : public Module
                                return 1;
                        }
                }
-               
+
                return 0;
        }
 
@@ -260,7 +260,7 @@ class ModuleMsgFlood : public Module
        {
                if (target_type == TYPE_CHANNEL)
                        return ProcessMessages(user,(Channel*)dest,text);
-               
+
                return 0;
        }
 
@@ -268,7 +268,7 @@ class ModuleMsgFlood : public Module
        {
                if (target_type == TYPE_CHANNEL)
                        return ProcessMessages(user,(Channel*)dest,text);
-                       
+
                return 0;
        }
 
@@ -288,10 +288,10 @@ class ModuleMsgFlood : public Module
                ServerInstance->Modes->DelMode(mf);
                delete mf;
        }
-       
+
        virtual Version GetVersion()
        {
-               return Version(1, 2, 0, 0, VF_COMMON | VF_VENDOR, API_VERSION);
+               return Version("$Id$", VF_COMMON | VF_VENDOR, API_VERSION);
        }
 };