]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_chanprotect.cpp
Tons of module versionflags stuff, and checks for it in /UNLOADMODULE
[user/henk/code/inspircd.git] / src / modules / m_chanprotect.cpp
index a357e898302d2caf5a7b478257026740f447000b..65a7b0e84c55fad5b307ee00dc191aff69eaae3a 100644 (file)
@@ -50,6 +50,32 @@ class ModuleChanProtect : public Module
                FirstInGetsFounder = Conf->ReadFlag("options","noservices",0);
        }
        
+        virtual void On005Numeric(std::string &output)
+        {
+                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=qa" + temp1;
+                        }
+                        temp2 = temp2 + temp1 + " ";
+                }
+               if (temp2.length())
+                       output = temp2.substr(0,temp2.length()-1);
+        }
+
+       virtual void OnUserPart(userrec* user, chanrec* channel)
+       {
+               // FIX: when someone parts a channel we must remove their Extensibles!
+               user->Shrink("cm_founder_"+std::string(channel->name));
+               user->Shrink("cm_protect_"+std::string(channel->name));
+       }
+
        virtual void OnRehash()
        {
                // on a rehash we delete our classes for good measure and create them again.
@@ -262,7 +288,7 @@ class ModuleChanProtect : public Module
        
        virtual Version GetVersion()
        {
-               return Version(1,0,0,0);
+               return Version(1,0,0,0,VF_STATIC|VF_VENDOR);
        }
        
        virtual string_list OnChannelSync(chanrec* chan)