summaryrefslogtreecommitdiff
path: root/src/xline.cpp
diff options
context:
space:
mode:
authorw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>2008-04-05 16:08:13 +0000
committerw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>2008-04-05 16:08:13 +0000
commitefce1ce1e7b05610bf765cafa82cc7618ed4872a (patch)
tree8d164243fa52355b2e531b8c8e51280ba86ed42c /src/xline.cpp
parent9b3aaf360202afd96ea968a3607fe535aab9fbc5 (diff)
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
Diffstat (limited to 'src/xline.cpp')
-rw-r--r--src/xline.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/xline.cpp b/src/xline.cpp
index 3f0ddbf2b..7ce6c3f0a 100644
--- a/src/xline.cpp
+++ b/src/xline.cpp
@@ -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);
}
}