]> git.netwichtig.de Git - user/henk/code/inspircd.git/blobdiff - src/bancache.cpp
Make m_password_hash able to pick up hasher modules after it's loaded, meaning m_md5...
[user/henk/code/inspircd.git] / src / bancache.cpp
index 472685f08099512ef3b3f99601664a2bd882eb1d..2254a117b3f0aaeb972a3e18b1780b5e8eb3e5d1 100644 (file)
@@ -2,7 +2,7 @@
  *       | Inspire Internet Relay Chat Daemon |
  *       +------------------------------------+
  *
- *  InspIRCd: (C) 2002-2007 InspIRCd Development Team
+ *  InspIRCd: (C) 2002-2008 InspIRCd Development Team
  * See: http://www.inspircd.org/wiki/index.php/Credits
  *
  * This program is free but copyrighted software; see
@@ -29,6 +29,19 @@ BanCacheHit *BanCacheManager::AddHit(const std::string &ip, const std::string &t
        return b;
 }
 
+BanCacheHit *BanCacheManager::AddHit(const std::string &ip, const std::string &type, const std::string &reason, time_t seconds)
+{
+       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(ServerInstance, ip, type, reason, seconds);
+
+       this->BanHash->insert(std::make_pair(ip, b));
+       return b;
+}
+
 BanCacheHit *BanCacheManager::GetHit(const std::string &ip)
 {
        BanCacheHash::iterator i = this->BanHash->find(ip);