]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_safelist.cpp
Fix potential for duplicate SID if the SID is auto generated.
[user/henk/code/inspircd.git] / src / modules / m_safelist.cpp
index 424d012561e07122ba9d40e080c1cdf252253c96..e23a00531821476a9d1bda78a070be2d90d62b94 100644 (file)
  *
  * ---------------------------------------------------
  */
-#include "users.h"
-#include "channels.h"
-#include "modules.h"
-#include "configreader.h"
+
 #include "inspircd.h"
 #include "wildcard.h"
 
@@ -43,7 +39,7 @@ class ModuleSafeList : public Module
        int global_listing;
        int LimitList;
  public:
-       ModuleSafeList(InspIRCd* Me) : Module::Module(Me)
+       ModuleSafeList(InspIRCd* Me) : Module(Me)
        {
                OnRehash(NULL, "");
        }
@@ -96,7 +92,7 @@ class ModuleSafeList : public Module
        {
                int minusers = 0, maxusers = 0;
 
-               if (global_listing >= LimitList)
+               if (global_listing >= LimitList && !IS_OPER(user))
                {
                        user->WriteServ("NOTICE %s :*** Server load is currently too heavy. Please try again later.", user->nick);
                        user->WriteServ("321 %s Channel :Users Name",user->nick);
@@ -266,26 +262,4 @@ class ModuleSafeList : public Module
 
 };
 
-
-class ModuleSafeListFactory : public ModuleFactory
-{
- public:
-       ModuleSafeListFactory()
-       {
-       }
-       ~ModuleSafeListFactory()
-       {
-       }
-       virtual Module * CreateModule(InspIRCd* Me)
-       {
-               return new ModuleSafeList(Me);
-       }
-};
-extern "C" void * init_module( void )
-{
-       return new ModuleSafeListFactory;
-}
+MODULE_INIT(ModuleSafeList)