]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_noinvite.cpp
Remove unneeded headers from spanningtree. This was done to the rest of the source...
[user/henk/code/inspircd.git] / src / modules / m_noinvite.cpp
index 2ed348daea116b481c0ff0adf163a120ed98abc8..c1d7f0d6f67e06888333e7c0dbe5f863faf293e2 100644 (file)
@@ -1,24 +1,16 @@
-/*   +------------------------------------+
- *   | Inspire Internet Relay Chat Daemon |
- *   +------------------------------------+
+/*       +------------------------------------+
+ *       | Inspire Internet Relay Chat Daemon |
+ *       +------------------------------------+
+ *
+ *  InspIRCd: (C) 2002-2007 InspIRCd Development Team
+ * See: http://www.inspircd.org/wiki/index.php/Credits
  *
- *  InspIRCd is copyright (C) 2002-2006 ChatSpike-Dev.
- *                   E-mail:
- *            <brain@chatspike.net>
- *            <Craig@chatspike.net>
- * 
- * Written by Craig Edwards, Craig McLure, and others.
  * This program is free but copyrighted software; see
- * the file COPYING for details.
+ *            the file COPYING for details.
  *
  * ---------------------------------------------------
  */
 
-using namespace std;
-
-#include "users.h"
-#include "channels.h"
-#include "modules.h"
 #include "inspircd.h"
 
 /* $ModDesc: Provides support for unreal-style channel mode +V */
@@ -56,10 +48,11 @@ class ModuleNoInvite : public Module
        NoInvite *ni;
  public:
 
-       ModuleNoInvite(InspIRCd* Me) : Module::Module(Me)
+       ModuleNoInvite(InspIRCd* Me) : Module(Me)
        {
                ni = new NoInvite(ServerInstance);
-               ServerInstance->AddMode(ni, 'V');
+               if (!ServerInstance->AddMode(ni, 'V'))
+                       throw ModuleException("Could not add new modes!");
        }
 
        void Implements(char* List)
@@ -85,31 +78,8 @@ class ModuleNoInvite : public Module
        
        virtual Version GetVersion()
        {
-               return Version(1,0,0,0,VF_COMMON|VF_VENDOR,API_VERSION);
-       }
-};
-
-
-class ModuleNoInviteFactory : public ModuleFactory
-{
- public:
-       ModuleNoInviteFactory()
-       {
-       }
-
-       ~ModuleNoInviteFactory()
-       {
-       }
-
-       virtual Module * CreateModule(InspIRCd* Me)
-       {
-               return new ModuleNoInvite(Me);
+               return Version(1,1,0,0,VF_COMMON|VF_VENDOR,API_VERSION);
        }
 };
 
-
-extern "C" void * init_module( void )
-{
-       return new ModuleNoInviteFactory;
-}
-
+MODULE_INIT(ModuleNoInvite)