]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_nokicks.cpp
Add sanity checks to the ssl modules so that theres no possibility of an out of range...
[user/henk/code/inspircd.git] / src / modules / m_nokicks.cpp
index 9f8e804f0e027dacf2f71457b8645300cb9ee3bb..93ab2bd1daea88e67443555dc4014b81926c2352 100644 (file)
  * ---------------------------------------------------
  */
 
-#include <stdio.h>
-#include "users.h"
-#include "channels.h"
-#include "modules.h"
 #include "inspircd.h"
 
 /* $ModDesc: Provides support for unreal-style channel mode +Q */
 
-
-
 class NoKicks : public ModeHandler
 {
  public:
@@ -57,11 +51,12 @@ class ModuleNoKicks : public Module
  public:
  
        ModuleNoKicks(InspIRCd* Me)
-               : Module::Module(Me)
+               : Module(Me)
        {
                
                nk = new NoKicks(ServerInstance);
-               ServerInstance->AddMode(nk, 'Q');
+               if (!ServerInstance->AddMode(nk, 'Q'))
+                       throw ModuleException("Could not add new modes!");
        }
 
        void Implements(char* List)
@@ -104,27 +99,4 @@ class ModuleNoKicks : public Module
 };
 
 
-class ModuleNoKicksFactory : public ModuleFactory
-{
- public:
-       ModuleNoKicksFactory()
-       {
-       }
-       
-       ~ModuleNoKicksFactory()
-       {
-       }
-       
-       virtual Module * CreateModule(InspIRCd* Me)
-       {
-               return new ModuleNoKicks(Me);
-       }
-       
-};
-
-
-extern "C" void * init_module( void )
-{
-       return new ModuleNoKicksFactory;
-}
-
+MODULE_INIT(ModuleNoKicks)