]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_stripcolor.cpp
Fixed compile problems... Move along please, nothing to see here..
[user/henk/code/inspircd.git] / src / modules / m_stripcolor.cpp
index 8d8b03cc0655ceaf59fa94200798a511e1ace45f..136f33d85514aca3fd0b5707ca15cefffdbb9b3c 100644 (file)
@@ -14,6 +14,8 @@
  * ---------------------------------------------------
  */
 
+using namespace std;
+
 #include <stdio.h>
 #include <string>
 #include "users.h"
@@ -28,9 +30,10 @@ class ModuleStripColor : public Module
  ConfigReader *Conf, *MyConf;
  
  public:
-       ModuleStripColor()
+       ModuleStripColor(Server* Me)
+               : Module::Module(Me)
        {
-               Srv = new Server;
+               Srv = Me;
 
                Srv->AddExtendedMode('S',MT_CHANNEL,false,0,0);
                Srv->AddExtendedMode('S',MT_CLIENT,false,0,0);
@@ -70,7 +73,6 @@ class ModuleStripColor : public Module
        
        virtual ~ModuleStripColor()
        {
-               delete Srv;
        }
        
        // ANSI colour stripping by Doc (Peter Wood)
@@ -80,7 +82,7 @@ class ModuleStripColor : public Module
                char sentence[MAXBUF];
                strncpy(sentence,text.c_str(),MAXBUF);
   
-               len = strlen (sentence);
+               len = strlen(sentence);
 
                for (i = 0; i < len; i++)
                {
@@ -99,23 +101,24 @@ class ModuleStripColor : public Module
                                case 3:
                                        remove = 1;
 
-                                       if (isdigit (sentence[i + remove]))
+                                       if (isdigit(sentence[i + remove]))
                                                remove++;
 
-                                       if (isdigit (sentence[i + remove]))
+                                       if (isdigit(sentence[i + remove]))
                                                remove++;
 
                                        if (sentence[i + remove] == ',')
                                        {
                                                remove += 2;
 
-                                               if (isdigit (sentence[i + remove]))
-                                               remove++;
+                                               if (isdigit(sentence[i + remove]))
+                                                       remove++;
                                        }
                                break;
                        }
 
-                       if (remove != 0) {
+                       if (remove != 0)
+                       {
                                len -= remove;
 
                                for (a = i; a <= len; a++)
@@ -188,9 +191,9 @@ class ModuleStripColorFactory : public ModuleFactory
        {
        }
        
-       virtual Module * CreateModule()
+       virtual Module * CreateModule(Server* Me)
        {
-               return new ModuleStripColor;
+               return new ModuleStripColor(Me);
        }
        
 };