summaryrefslogtreecommitdiff
path: root/src/modules/m_cgiirc.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules/m_cgiirc.cpp')
-rw-r--r--src/modules/m_cgiirc.cpp32
1 files changed, 15 insertions, 17 deletions
diff --git a/src/modules/m_cgiirc.cpp b/src/modules/m_cgiirc.cpp
index f1ead276d..a5144e36d 100644
--- a/src/modules/m_cgiirc.cpp
+++ b/src/modules/m_cgiirc.cpp
@@ -279,24 +279,22 @@ public:
{
std::string *webirc_hostname = cmd.webirc_hostname.get(user);
std::string *webirc_ip = cmd.webirc_ip.get(user);
+ if (!webirc_ip)
+ return;
+ ServerInstance->Users->RemoveCloneCounts(user);
+ user->SetClientIP(webirc_ip->c_str());
+ user->InvalidateCache();
if (webirc_hostname && webirc_hostname->length() < 64)
- {
- user->host = *webirc_hostname;
- user->dhost = *webirc_hostname;
- user->InvalidateCache();
- }
- if (webirc_ip)
- {
- ServerInstance->Users->RemoveCloneCounts(user);
- user->SetClientIP(webirc_ip->c_str());
- user->InvalidateCache();
- cmd.webirc_ip.unset(user);
- ServerInstance->Users->AddLocalClone(user);
- ServerInstance->Users->AddGlobalClone(user);
- user->SetClass();
- user->CheckClass();
- user->CheckLines(true);
- }
+ user->host = user->dhost = *webirc_hostname;
+ else
+ user->host = user->dhost = user->GetIPString();
+ user->InvalidateCache();
+ ServerInstance->Users->AddLocalClone(user);
+ ServerInstance->Users->AddGlobalClone(user);
+ user->SetClass();
+ user->CheckClass();
+ user->CheckLines(true);
+ cmd.webirc_ip.unset(user);
cmd.webirc_hostname.unset(user);
}