]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_blockcolor.cpp
Added version flags
[user/henk/code/inspircd.git] / src / modules / m_blockcolor.cpp
index a4e5acc1df9abf8bba2399ccf358861e9930d7d9..9a6da0fae12574fc626e31ecb43fa82fdf658180 100644 (file)
@@ -15,6 +15,7 @@
  */
 
 #include <stdio.h>
+#include <sstream>
 #include "users.h"
 #include "channels.h"
 #include "modules.h"
@@ -31,8 +32,28 @@ class ModuleBlockColor : public Module
                Srv = new Server;
                Srv->AddExtendedMode('c',MT_CHANNEL,false,0,0);
        }
+
+        virtual void On005Numeric(std::string &output)
+        {
+                // we don't really have a limit...
+               std::stringstream line(output);
+               std::string temp1, temp2;
+               while (!line.eof())
+               {
+                       line >> temp1;
+                       if (temp1.substr(0,10) == "CHANMODES=")
+                       {
+                               // append the chanmode to the end
+                               temp1 = temp1.substr(10,temp1.length());
+                               temp1 = "CHANMODES=" + temp1 + "c";
+                       }
+                       temp2 = temp2 + temp1 + " ";
+               }
+               if (temp2.length())
+                       output = temp2.substr(0,temp2.length()-1);
+        }
        
-       virtual int OnUserPreMessage(userrec* user,void* dest,int target_type, std::string text)
+       virtual int OnUserPreMessage(userrec* user,void* dest,int target_type, std::string &text)
        {
                if (target_type == TYPE_CHANNEL)
                {
@@ -51,7 +72,7 @@ class ModuleBlockColor : public Module
                return 0;
        }
        
-       virtual int OnUserPreNotice(userrec* user,void* dest,int target_type, std::string text)
+       virtual int OnUserPreNotice(userrec* user,void* dest,int target_type, std::string &text)
        {
                if (target_type == TYPE_CHANNEL)
                {
@@ -75,6 +96,7 @@ class ModuleBlockColor : public Module
                // check if this is our mode character...
                if ((modechar == 'c') && (type == MT_CHANNEL))
                {
+                       log(DEBUG,"Allowing c change");
                        return 1;
                }
                else
@@ -90,7 +112,7 @@ class ModuleBlockColor : public Module
        
        virtual Version GetVersion()
        {
-               return Version(1,0,0,0);
+               return Version(1,0,0,0,VF_STATIC);
        }
 };