]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_botmode.cpp
Decide that it wasn't quite appropriate :(
[user/henk/code/inspircd.git] / src / modules / m_botmode.cpp
index f53f8bedac8a85ce931a2eff0f58f48d7cb526cf..04204b42ece8e54b79c46a7b3e2ca4518a764246 100644 (file)
@@ -2,7 +2,7 @@
  *       | Inspire Internet Relay Chat Daemon |
  *       +------------------------------------+
  *
- *  Inspire is copyright (C) 2002-2004 ChatSpike-Dev.
+ *  InspIRCd is copyright (C) 2002-2006 ChatSpike-Dev.
  *                       E-mail:
  *                <brain@chatspike.net>
  *               <Craig@chatspike.net>
@@ -14,6 +14,8 @@
  * ---------------------------------------------------
  */
 
+using namespace std;
+
 #include <stdio.h>
 #include <string>
 #include "users.h"
@@ -26,21 +28,25 @@ class ModuleBotMode : public Module
 {
        Server *Srv; 
  public:
-       ModuleBotMode()
+       ModuleBotMode(Server* Me)
+               : Module::Module(Me)
        {
-               Srv = new Server;
+               Srv = Me;
                
                if (!Srv->AddExtendedMode('B',MT_CLIENT,false,0,0))
                {
                        Srv->Log(DEFAULT,"*** m_botmode: ERROR, failed to allocate user mode +B!");
-                       printf("Could not claim usermode +B for this module!");
-                       exit(0);
+                       return;
                }
        }
+
+       void Implements(char* List)
+       {
+               List[I_OnWhois] = List[I_OnExtendedMode] = 1;
+       }
        
        virtual ~ModuleBotMode()
        {
-               delete Srv;
        }
        
        virtual Version GetVersion()
@@ -83,9 +89,9 @@ class ModuleBotModeFactory : public ModuleFactory
        {
        }
        
-       virtual Module * CreateModule()
+       virtual Module * CreateModule(Server* Me)
        {
-               return new ModuleBotMode;
+               return new ModuleBotMode(Me);
        }
        
 };