]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/users.cpp
Release v3.8.0.
[user/henk/code/inspircd.git] / src / users.cpp
index 0800b2f89fc83e5d6f729f326105e6f4f957a026..7a11f22c8900e60a37e9a5c57c0d177ad9527e9c 100644 (file)
@@ -1016,8 +1016,8 @@ bool User::ChangeRealName(const std::string& real)
                FIRST_MOD_RESULT(OnPreChangeRealName, MOD_RESULT, (IS_LOCAL(this), real));
                if (MOD_RESULT == MOD_RES_DENY)
                        return false;
-               FOREACH_MOD(OnChangeRealName, (this, real));
        }
+       FOREACH_MOD(OnChangeRealName, (this, real));
        this->realname.assign(real, 0, ServerInstance->Config->Limits.MaxReal);
 
        return true;
@@ -1075,6 +1075,10 @@ void User::ChangeRealHost(const std::string& host, bool resetdisplay)
        if (!changehost)
                return;
 
+       // Don't call the OnChangeRealHost event when initialising a user.
+       if (!realhost.empty())
+               FOREACH_MOD(OnChangeRealHost, (this, host));
+
        realhost = host;
        this->InvalidateCache();
 }
@@ -1145,7 +1149,7 @@ void LocalUser::SetClass(const std::string &explicit_name)
 
                        /* check if host matches.. */
                        if (!InspIRCd::MatchCIDR(this->GetIPString(), c->GetHost(), NULL) &&
-                           !InspIRCd::MatchCIDR(this->GetRealHost(), c->GetHost(), NULL))
+                               !InspIRCd::MatchCIDR(this->GetRealHost(), c->GetHost(), NULL))
                        {
                                ServerInstance->Logs->Log("CONNECTCLASS", LOG_DEBUG, "No host match (for %s)", c->GetHost().c_str());
                                continue;