summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/modules/m_cgiirc.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/modules/m_cgiirc.cpp b/src/modules/m_cgiirc.cpp
index 482c6447c..13f1c1fb5 100644
--- a/src/modules/m_cgiirc.cpp
+++ b/src/modules/m_cgiirc.cpp
@@ -192,7 +192,13 @@ class ModuleCgiIRC : public Module
static void ChangeIP(LocalUser* user, const std::string& newip)
{
ServerInstance->Users->RemoveCloneCounts(user);
+ const std::string oldip(user->GetIPString());
user->SetClientIP(newip.c_str());
+ user->InvalidateCache();
+ if (user->host == oldip)
+ user->host = user->GetIPString();
+ if (user->dhost == oldip)
+ user->dhost = user->GetIPString();
ServerInstance->Users->AddLocalClone(user);
ServerInstance->Users->AddGlobalClone(user);
}