]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/modules/m_cloaking.cpp
More cleanup of quit servers
[user/henk/code/inspircd.git] / src / modules / m_cloaking.cpp
index 1f9854a78eeeb6d9da7b6cc969578e4174b81baf..0405e31dd2d93e530e656db0f47ed879504e7152 100644 (file)
@@ -120,6 +120,10 @@ class ModuleCloaking : public Module
 
  public:
        ModuleCloaking() : cu(this), Hash(this, "hash/md5")
+       {
+       }
+
+       void init()
        {
                OnRehash(NULL);
 
@@ -332,9 +336,23 @@ class ModuleCloaking : public Module
 
        Version GetVersion()
        {
-               // returns the version number of the module to be
-               // listed in /MODULES
-               return Version("Provides masking of user hostnames", VF_COMMON|VF_VENDOR);
+               std::string testcloak;
+               switch (mode)
+               {
+                       case MODE_COMPAT_HOST:
+                               testcloak = prefix + "-" + Hash->sumIV(compatkey, xtab[0], "*").substr(0,10);
+                               break;
+                       case MODE_COMPAT_IPONLY:
+                               testcloak = Hash->sumIV(compatkey, xtab[0], "*").substr(0,10);
+                               break;
+                       case MODE_HALF_CLOAK:
+                               testcloak = prefix + SegmentCloak("*", 3);
+                               break;
+                       case MODE_OPAQUE:
+                       default:
+                               testcloak = prefix + SegmentCloak("*", 4);
+               }
+               return Version("Provides masking of user hostnames", VF_COMMON|VF_VENDOR, testcloak);
        }
 
        void OnRehash(User* user)
@@ -420,9 +438,6 @@ class ModuleCloaking : public Module
                if (cloak)
                        return;
 
-               if (dest->host.find('.') == std::string::npos && dest->host.find(':') == std::string::npos)
-                       return;
-
                std::string ipstr = dest->GetIPString();
                std::string chost;