From f310e1c98dc262249146025ffffb81334b38680d Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Tue, 24 Jan 2023 02:58:46 +0000 Subject: Refactor the caching methods in User and rename to make more sense. --- src/xline.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/xline.cpp') diff --git a/src/xline.cpp b/src/xline.cpp index 10ca2b95f..6cc44447f 100644 --- a/src/xline.cpp +++ b/src/xline.cpp @@ -576,8 +576,8 @@ void XLine::DefaultApply(User* u, const std::string& line, bool bancache) if (bancache) { - ServerInstance->Logs.Debug("BANCACHE", "BanCache: Adding positive hit (" + line + ") for " + u->GetIPString()); - ServerInstance->BanCache.AddHit(u->GetIPString(), this->type, banReason, (this->duration > 0 ? (this->expiry - ServerInstance->Time()) : 0)); + ServerInstance->Logs.Debug("BANCACHE", "BanCache: Adding positive hit (" + line + ") for " + u->GetAddress()); + ServerInstance->BanCache.AddHit(u->GetAddress(), this->type, banReason, (this->duration > 0 ? (this->expiry - ServerInstance->Time()) : 0)); } } @@ -590,7 +590,7 @@ bool KLine::Matches(User* u) if (InspIRCd::Match(u->ident, this->identmask, ascii_case_insensitive_map)) { if (InspIRCd::MatchCIDR(u->GetRealHost(), this->hostmask, ascii_case_insensitive_map) || - InspIRCd::MatchCIDR(u->GetIPString(), this->hostmask, ascii_case_insensitive_map)) + InspIRCd::MatchCIDR(u->GetAddress(), this->hostmask, ascii_case_insensitive_map)) { return true; } @@ -613,7 +613,7 @@ bool GLine::Matches(User* u) if (InspIRCd::Match(u->ident, this->identmask, ascii_case_insensitive_map)) { if (InspIRCd::MatchCIDR(u->GetRealHost(), this->hostmask, ascii_case_insensitive_map) || - InspIRCd::MatchCIDR(u->GetIPString(), this->hostmask, ascii_case_insensitive_map)) + InspIRCd::MatchCIDR(u->GetAddress(), this->hostmask, ascii_case_insensitive_map)) { return true; } @@ -632,7 +632,7 @@ bool ELine::Matches(User* u) if (InspIRCd::Match(u->ident, this->identmask, ascii_case_insensitive_map)) { if (InspIRCd::MatchCIDR(u->GetRealHost(), this->hostmask, ascii_case_insensitive_map) || - InspIRCd::MatchCIDR(u->GetIPString(), this->hostmask, ascii_case_insensitive_map)) + InspIRCd::MatchCIDR(u->GetAddress(), this->hostmask, ascii_case_insensitive_map)) { return true; } @@ -647,7 +647,7 @@ bool ZLine::Matches(User* u) if (lu && lu->exempt) return false; - return InspIRCd::MatchCIDR(u->GetIPString(), this->ipaddr); + return InspIRCd::MatchCIDR(u->GetAddress(), this->ipaddr); } void ZLine::Apply(User* u) -- cgit v1.3.1-10-gc9f91