]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/extra/m_filter_pcre.cpp
Changed behaviour of module API to pass Server* to the constructor, rather than have...
[user/henk/code/inspircd.git] / src / modules / extra / m_filter_pcre.cpp
index 0cc7fcc26725723f61c678ad3d10d4774fadf7e2..0e36115b9e2d5f9f6abb404e9ecae34a48758967 100644 (file)
@@ -41,14 +41,15 @@ class ModuleFilterPCRE : public Module
        int erroffset;
  
  public:
-       ModuleFilterPCRE()
+       ModuleFilterPCRE(Server* Me)
+               : Module::Module(Me)
        {
                // read the configuration file on startup.
-               // it is perfectly valid to set <FilterPCRE file> to the value of the
+               // it is perfectly valid to set <filter file> to the value of the
                // main config file, then append your <keyword> tags to the bottom
                // of the main config... but rather messy. That's why the capability
                // of using a seperate config file is provided.
-               Srv = new Server;
+               Srv = Me;
                Conf = new ConfigReader;
                std::string filterfile = Conf->ReadValue("filter","file",0);
                MyConf = new ConfigReader(filterfile);
@@ -81,7 +82,6 @@ class ModuleFilterPCRE : public Module
        
        virtual ~ModuleFilterPCRE()
        {
-               delete Srv;
                delete MyConf;
                delete Conf;
        }
@@ -180,7 +180,7 @@ class ModuleFilterPCRE : public Module
                return 0;
        }
        
-       virtual void OnRehash()
+       virtual void OnRehash(std::string parameter)
        {
                // reload our config file on rehash - we must destroy and re-allocate the classes
                // to call the constructor again and re-read our data.
@@ -239,9 +239,9 @@ class ModuleFilterPCREFactory : public ModuleFactory
        {
        }
        
-       virtual Module * CreateModule()
+       virtual Module * CreateModule(Server* Me)
        {
-               return new ModuleFilterPCRE;
+               return new ModuleFilterPCRE(Me);
        }
        
 };