]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_filter.cpp
Auto loading of commands as shared objects via dlsym (very lightweight interface...
[user/henk/code/inspircd.git] / src / modules / m_filter.cpp
index a0c2a97c2fa173b444d8eb1805ce09e4b539509b..775130f356e32eb4ea819ebe8e44ff1cece844de 100644 (file)
@@ -25,12 +25,12 @@ using namespace std;
 #include "users.h"
 #include "channels.h"
 #include "modules.h"
-#include "helperfuncs.h"
+
 #include "inspircd.h"
 
 /* $ModDesc: An enhanced version of the unreal m_filter.so used by chatspike.net */
 
-extern InspIRCd* ServerInstance;
+
 
 class Filter : public classbase
 {
@@ -110,7 +110,7 @@ class ModuleFilter : public Module
                                        ServerInstance->WriteOpers(std::string("FILTER: ")+user->nick+" had their notice filtered, target was "+target+": "+f->reason);
                                        user->WriteServ("NOTICE "+std::string(user->nick)+" :Your notice has been filtered and opers notified: "+f->reason);
                                }
-                               log(DEFAULT,"FILTER: "+std::string(user->nick)+std::string(" had their notice filtered, target was ")+target+": "+f->reason+" Action: "+f->action);
+                               ServerInstance->Log(DEFAULT,"FILTER: "+std::string(user->nick)+std::string(" had their notice filtered, target was ")+target+": "+f->reason+" Action: "+f->action);
 
                                if (f->action == "kill")
                                {
@@ -126,10 +126,10 @@ class ModuleFilter : public Module
        {
                // reload our config file on rehash - we must destroy and re-allocate the classes
                // to call the constructor again and re-read our data.
-               ConfigReader* Conf = new ConfigReader;
+               ConfigReader* Conf = new ConfigReader(ServerInstance);
                std::string filterfile = Conf->ReadValue("filter","file",0);
                // this automatically re-reads the configuration file into the class
-               ConfigReader* MyConf = new ConfigReader(filterfile);
+               ConfigReader* MyConf = new ConfigReader(ServerInstance, filterfile);
                if ((filterfile == "") || (!MyConf->Verify()))
                {
                        // bail if the user forgot to create a config file
@@ -153,7 +153,7 @@ class ModuleFilter : public Module
                        x->action = do_action;
                        filters[pattern] = x;
                }
-               log(DEFAULT,"m_filter: read configuration from "+filterfile);
+               ServerInstance->Log(DEFAULT,"m_filter: read configuration from "+filterfile);
                DELETE(Conf);
                DELETE(MyConf);
        }