]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_hostchange.cpp
Tidyup
[user/henk/code/inspircd.git] / src / modules / m_hostchange.cpp
index 512af06cd8c91c7eeb1c501e3a1031ce5f59493b..3d036621424b7a3ea2af363de3ee4639735e0b31 100644 (file)
@@ -24,8 +24,8 @@ using namespace std;
 
 /* $ModDesc: Provides masking of user hostnames in a different way to m_cloaking */
 
-extern InspIRCd* ServerInstance;
-
+/** Holds information on a host set by m_hostchange
+ */
 class Host : public classbase
 {
  public:
@@ -39,7 +39,7 @@ class ModuleHostChange : public Module
 {
  private:
 
-       Server *Srv;
+       
        ConfigReader *Conf;
        hostchanges_t hostchanges;
        std::string MySuffix;
@@ -49,7 +49,7 @@ class ModuleHostChange : public Module
                : Module::Module(Me)
        {
                
-               Conf = new ConfigReader;
+               Conf = new ConfigReader(ServerInstance);
                OnRehash("");
        }
        
@@ -71,7 +71,7 @@ class ModuleHostChange : public Module
        virtual void OnRehash(const std::string &parameter)
        {
                DELETE(Conf);
-               Conf = new ConfigReader;
+               Conf = new ConfigReader(ServerInstance);
                MySuffix = Conf->ReadValue("host","suffix",0);
                for (hostchanges_t::iterator i = hostchanges.begin(); i != hostchanges.end(); i++)
                {
@@ -94,14 +94,14 @@ class ModuleHostChange : public Module
        {
                // returns the version number of the module to be
                // listed in /MODULES
-               return Version(1,0,0,1,VF_VENDOR);
+               return Version(1,1,0,1,VF_VENDOR,API_VERSION);
        }
        
        virtual void OnUserConnect(userrec* user)
        {
                for (hostchanges_t::iterator i = hostchanges.begin(); i != hostchanges.end(); i++)
                {
-                       if (Srv->MatchText(std::string(user->ident)+"@"+std::string(user->host),i->first))
+                       if (ServerInstance->MatchText(std::string(user->ident)+"@"+std::string(user->host),i->first))
                        {
                                Host* h = (Host*)i->second;
                                // host of new user matches a hostchange tag's mask