]> 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 f3f5d537ac65b6efa5eb311354f9b101c6331dec..93ab2bd1daea88e67443555dc4014b81926c2352 100644 (file)
@@ -2,30 +2,19 @@
  *       | Inspire Internet Relay Chat Daemon |
  *       +------------------------------------+
  *
- *  InspIRCd is copyright (C) 2002-2006 ChatSpike-Dev.
- *                       E-mail:
- *                <brain@chatspike.net>
- *               <Craig@chatspike.net>
- *     
- * Written by Craig Edwards, Craig McLure, and others.
+ *  InspIRCd: (C) 2002-2007 InspIRCd Development Team
+ * See: http://www.inspircd.org/wiki/index.php/Credits
+ *
  * This program is free but copyrighted software; see
  *            the file COPYING for details.
  *
  * ---------------------------------------------------
  */
 
-using namespace std;
-
-#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:
@@ -62,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,32 +94,9 @@ class ModuleNoKicks : public Module
        
        virtual Version GetVersion()
        {
-               return Version(1,0,0,0,VF_COMMON|VF_VENDOR);
-       }
-};
-
-
-class ModuleNoKicksFactory : public ModuleFactory
-{
- public:
-       ModuleNoKicksFactory()
-       {
-       }
-       
-       ~ModuleNoKicksFactory()
-       {
-       }
-       
-       virtual Module * CreateModule(InspIRCd* Me)
-       {
-               return new ModuleNoKicks(Me);
+               return Version(1,1,0,0,VF_COMMON|VF_VENDOR,API_VERSION);
        }
-       
 };
 
 
-extern "C" void * init_module( void )
-{
-       return new ModuleNoKicksFactory;
-}
-
+MODULE_INIT(ModuleNoKicks)