Fix bug (partially/accidentally) discovered by Bricker: if an XLine is not permanent, bancache should use the expiry time of the xline, not an arbitrary value

git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@9356 e03df62e-2008-0410-955e-edbf42e46eb7
This commit is contained in:
w00t 2008-04-05 16:08:13 +00:00
parent 9b3aaf3602
commit efce1ce1e7

View File

@ -411,7 +411,10 @@ void XLine::DefaultApply(User* u, const std::string &line, bool bancache)
if (bancache)
{
ServerInstance->Logs->Log("BANCACHE", DEBUG, std::string("BanCache: Adding positive hit (") + line + ") for " + u->GetIPString());
ServerInstance->BanCache->AddHit(u->GetIPString(), this->type, line + "-Lined: " + this->reason);
if (this->duration > 0)
ServerInstance->BanCache->AddHit(u->GetIPString(), this->type, line + "-Lined: " + this->reason, this->duration);
else
ServerInstance->BanCache->AddHit(u->GetIPString(), this->type, line + "-Lined: " + this->reason);
}
}