summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/bancache.cpp15
-rw-r--r--src/xline.cpp5
2 files changed, 2 insertions, 18 deletions
diff --git a/src/bancache.cpp b/src/bancache.cpp
index 52449e55e..72f8728d3 100644
--- a/src/bancache.cpp
+++ b/src/bancache.cpp
@@ -23,19 +23,6 @@
#include "inspircd.h"
#include "bancache.h"
-BanCacheHit *BanCacheManager::AddHit(const std::string &ip, const std::string &type, const std::string &reason)
-{
- BanCacheHit *b;
-
- if (this->BanHash->find(ip) != this->BanHash->end()) // can't have two cache entries on the same IP, sorry..
- return NULL;
-
- b = new BanCacheHit(ip, type, reason);
-
- this->BanHash->insert(std::make_pair(ip, b));
- return b;
-}
-
BanCacheHit *BanCacheManager::AddHit(const std::string &ip, const std::string &type, const std::string &reason, time_t seconds)
{
BanCacheHit *b;
@@ -43,7 +30,7 @@ BanCacheHit *BanCacheManager::AddHit(const std::string &ip, const std::string &t
if (this->BanHash->find(ip) != this->BanHash->end()) // can't have two cache entries on the same IP, sorry..
return NULL;
- b = new BanCacheHit(ip, type, reason, seconds);
+ b = new BanCacheHit(ip, type, reason, (seconds ? seconds : 86400));
this->BanHash->insert(std::make_pair(ip, b));
return b;
diff --git a/src/xline.cpp b/src/xline.cpp
index 53cbe5c96..2fdf71b17 100644
--- a/src/xline.cpp
+++ b/src/xline.cpp
@@ -545,10 +545,7 @@ void XLine::DefaultApply(User* u, const std::string &line, bool bancache)
if (bancache)
{
ServerInstance->Logs->Log("BANCACHE", DEBUG, "BanCache: Adding positive hit (" + line + ") for " + u->GetIPString());
- 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);
+ ServerInstance->BanCache->AddHit(u->GetIPString(), this->type, line + "-Lined: " + this->reason, this->duration);
}
}