]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/users.cpp
Remove some uline checks that ran after an IS_LOCAL() check
[user/henk/code/inspircd.git] / src / users.cpp
index e55c7e0997346412daca37b43e35caddb6126f66..adfa7642cffc7278cfb0aa4fd8592db9422a4324 100644 (file)
@@ -987,36 +987,39 @@ irc::sockets::cidr_mask User::GetCIDRMask()
        return irc::sockets::cidr_mask(client_sa, range);
 }
 
-bool User::SetClientIP(const char* sip)
+bool User::SetClientIP(const char* sip, bool recheck_eline)
 {
        cachedip.clear();
        cached_hostip.clear();
        return irc::sockets::aptosa(sip, 0, client_sa);
 }
 
-void User::SetClientIP(const irc::sockets::sockaddrs& sa)
+void User::SetClientIP(const irc::sockets::sockaddrs& sa, bool recheck_eline)
 {
        cachedip.clear();
        cached_hostip.clear();
        memcpy(&client_sa, &sa, sizeof(irc::sockets::sockaddrs));
 }
 
-bool LocalUser::SetClientIP(const char* sip)
+bool LocalUser::SetClientIP(const char* sip, bool recheck_eline)
 {
        irc::sockets::sockaddrs sa;
        if (!irc::sockets::aptosa(sip, 0, sa))
                // Invalid
                return false;
 
-       LocalUser::SetClientIP(sa);
+       LocalUser::SetClientIP(sa, recheck_eline);
        return true;
 }
 
-void LocalUser::SetClientIP(const irc::sockets::sockaddrs& sa)
+void LocalUser::SetClientIP(const irc::sockets::sockaddrs& sa, bool recheck_eline)
 {
        if (sa != client_sa)
        {
                User::SetClientIP(sa);
+               if (recheck_eline)
+                       this->exempt = (ServerInstance->XLines->MatchesLine("E", this) != NULL);
+
                FOREACH_MOD(I_OnSetUserIP,OnSetUserIP(this));
        }
 }
@@ -1483,7 +1486,7 @@ bool User::ChangeIdent(const char* newident)
 
        std::string quitstr = ":" + GetFullHost() + " QUIT :Changing ident";
 
-       this->ident.assign(newident, 0, ServerInstance->Config->Limits.IdentMax + 1);
+       this->ident.assign(newident, 0, ServerInstance->Config->Limits.IdentMax);
 
        this->InvalidateCache();