]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Update the cloaks of connected users when their IP address changes.
authorPeter Powell <petpow@saberuk.com>
Thu, 13 Dec 2018 16:58:39 +0000 (16:58 +0000)
committerPeter Powell <petpow@saberuk.com>
Thu, 13 Dec 2018 16:58:39 +0000 (16:58 +0000)
src/modules/m_cloaking.cpp

index 756781ef052e6167dd5caf2dd70dc119b751d295..3b00d3347aa5018f5edebbcdd5239d91c4f674a7 100644 (file)
@@ -466,6 +466,24 @@ class ModuleCloaking : public Module
                return chost;
        }
 
+       void OnSetUserIP(LocalUser* user) CXX11_OVERRIDE
+       {
+               // Connecting users are handled in OnUserConnect not here.
+               if (user->registered != REG_ALL)
+                       return;
+
+               // Remove the cloaks and generate new ones.
+               cu.ext.unset(user);
+               OnUserConnect(user);
+
+               // If a user is using a cloak then update it.
+               if (user->IsModeSet(cu))
+               {
+                       CloakList* cloaklist = cu.ext.get(user);
+                       user->ChangeDisplayedHost(cloaklist->front());
+               }
+       }
+
        void OnUserConnect(LocalUser* dest) CXX11_OVERRIDE
        {
                if (cu.ext.get(dest))