]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_blockcolor.cpp
We were already sending FMODE +nt after each channel creation to keep services happy...
[user/henk/code/inspircd.git] / src / modules / m_blockcolor.cpp
index a40d4ebd3f11439d8c98de462e5fd8648d98afd7..6dd42209fc8e1b3f88600787ff8078bfdb6f9a81 100644 (file)
  * ---------------------------------------------------
  */
 
-#include <stdio.h>
-#include <sstream>
+#include "inspircd.h"
 #include "users.h"
 #include "channels.h"
 #include "modules.h"
-#include "inspircd.h"
 
 /* $ModDesc: Provides support for unreal-style channel mode +c */
 
@@ -56,28 +54,19 @@ class ModuleBlockColour : public Module
        BlockColor *bc;
  public:
  
-       ModuleBlockColour(InspIRCd* Me) : Module::Module(Me)
+       ModuleBlockColour(InspIRCd* Me) : Module(Me)
        {
                bc = new BlockColor(ServerInstance);
                if (!ServerInstance->AddMode(bc, 'c'))
                        throw ModuleException("Could not add new modes!");
-
-               OnRehash(NULL, "");
        }
 
        void Implements(char* List)
        {
-               List[I_OnRehash] = List[I_OnUserPreMessage] = List[I_OnUserPreNotice] = 1;
+               List[I_OnUserPreMessage] = List[I_OnUserPreNotice] = 1;
        }
 
 
-       virtual void OnRehash(userrec* user, const std::string &parameter)
-       {
-               ConfigReader Conf(ServerInstance);
-
-               AllowChanOps = Conf.ReadFlag("blockcolor", "allowchanops", 0);
-       }
-
        virtual int OnUserPreMessage(userrec* user,void* dest,int target_type, std::string &text, char status, CUList &exempt_list)
        {
                if ((target_type == TYPE_CHANNEL) && (IS_LOCAL(user)))
@@ -86,7 +75,7 @@ class ModuleBlockColour : public Module
                        
                        if(c->IsModeSet('c'))
                        {
-                               if (!AllowChanOps || AllowChanOps && c->GetStatus(user) != STATUS_OP)
+                               if (!CHANOPS_EXEMPT(ServerInstance, 'c') || CHANOPS_EXEMPT(ServerInstance, 'c') && c->GetStatus(user) != STATUS_OP)
                                {
                                        for (std::string::iterator i = text.begin(); i != text.end(); i++)
                                        {
@@ -146,7 +135,7 @@ class ModuleBlockColourFactory : public ModuleFactory
 };
 
 
-extern "C" void * init_module( void )
+extern "C" DllExport void * init_module( void )
 {
        return new ModuleBlockColourFactory;
 }