From e40da2341cfcd6580075571d325105b9a9fe783a Mon Sep 17 00:00:00 2001 From: Perttu Ahola Date: Fri, 12 Aug 2011 13:11:27 +0300 Subject: Fixed/extended/modified ban stuff to be good for inclusion --- src/ban.h | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'src/ban.h') diff --git a/src/ban.h b/src/ban.h index 38b08b604..8fdcf4c6a 100644 --- a/src/ban.h +++ b/src/ban.h @@ -20,7 +20,7 @@ with this program; if not, write to the Free Software Foundation, Inc., #ifndef BAN_HEADER #define BAN_HEADER -#include +#include #include #include #include @@ -34,14 +34,17 @@ public: ~BanManager(); void load(); void save(); - void add(std::string ip); - void remove(std::string ip); - bool isIpBanned(std::string ip); + bool isIpBanned(const std::string &ip); + // Supplying ip_or_name = "" lists all bans. + std::string getBanDescription(const std::string &ip_or_name); + std::string getBanName(const std::string &ip); + void add(const std::string &ip, const std::string &name); + void remove(const std::string &ip_or_name); bool isModified(); private: JMutex m_mutex; std::string m_banfilepath; - std::set m_ips; + std::map m_ips; bool m_modified; }; -- cgit v1.2.3