]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_cloaking.cpp
Merge pull request #959 from Alef-Burzmali/master+fixcloaking
[user/henk/code/inspircd.git] / src / modules / m_cloaking.cpp
index 4e203d14c97a8079c06b946d5ef6196ef9a0ee37..d0e7313b7c946bfdefbb26dde925e536a20267e2 100644 (file)
@@ -99,7 +99,7 @@ class CloakUser : public ModeHandler
                        }
                        if (cloak)
                        {
-                               user->ChangeDisplayedHost(cloak->c_str());
+                               user->ChangeDisplayedHost(*cloak);
                                user->SetMode(this, true);
                                return MODEACTION_ALLOW;
                        }
@@ -146,15 +146,6 @@ class ModuleCloaking : public Module
        {
        }
 
-       void init() CXX11_OVERRIDE
-       {
-               OnRehash(NULL);
-
-               ServerInstance->Modules->AddService(cu);
-               ServerInstance->Modules->AddService(ck);
-               ServerInstance->Modules->AddService(cu.ext);
-       }
-
        /** This function takes a domain name string and returns just the last two domain parts,
         * or the last domain part if only two are available. Failing that it just returns what it was given.
         *
@@ -201,7 +192,7 @@ class ModuleCloaking : public Module
                input.append(1, '\0'); // null does not terminate a C++ string
                input.append(item);
 
-               std::string rv = Hash->sum(input).substr(0,len);
+               std::string rv = Hash->GenerateRaw(input).substr(0,len);
                for(int i=0; i < len; i++)
                {
                        // this discards 3 bits per byte. We have an
@@ -310,7 +301,7 @@ class ModuleCloaking : public Module
                if (u->IsModeSet(cu))
                {
                        u->SetMode(cu, false);
-                       u->WriteServ("MODE %s -%c", u->nick.c_str(), cu.GetModeChar());
+                       u->WriteCommand("MODE", "-" + ConvToStr(cu.GetModeChar()));
                }
        }
 
@@ -331,7 +322,7 @@ class ModuleCloaking : public Module
                return Version("Provides masking of user hostnames", VF_COMMON|VF_VENDOR, testcloak);
        }
 
-       void OnRehash(User* user) CXX11_OVERRIDE
+       void ReadConfig(ConfigStatus& status) CXX11_OVERRIDE
        {
                ConfigTag* tag = ServerInstance->Config->ConfValue("cloak");
                prefix = tag->getString("prefix");