diff options
-rw-r--r-- | include/xline.h | 6 | ||||
-rw-r--r-- | src/xline.cpp | 22 |
2 files changed, 27 insertions, 1 deletions
diff --git a/include/xline.h b/include/xline.h index 0fa6e3f53..9fd4d0bea 100644 --- a/include/xline.h +++ b/include/xline.h @@ -61,6 +61,8 @@ class CoreExport XLine : public classbase */ virtual bool Matches(User *u) = 0; + virtual bool Matches(const std::string &str); + /** The time the line was added. */ time_t set_time; @@ -217,6 +219,8 @@ class CoreExport ZLine : public XLine virtual bool Matches(User *u); + virtual bool Matches(const std::string &str); + /** IP mask */ char* ipaddr; @@ -248,6 +252,8 @@ class CoreExport QLine : public XLine } virtual bool Matches(User *u); + virtual bool Matches(const std::string &str); + /** Nickname mask */ char* nick; diff --git a/src/xline.cpp b/src/xline.cpp index a6ed0e605..71e94aab7 100644 --- a/src/xline.cpp +++ b/src/xline.cpp @@ -650,7 +650,10 @@ XLineManager::XLineManager(InspIRCd* Instance) : ServerInstance(Instance) { } - +virtual bool Matches(const std::string &str) +{ + return false; +} bool KLine::Matches(User *u) { @@ -706,3 +709,20 @@ bool QLine::Matches(User *u) return false; } + +bool ZLine::Matches(const std::string &str) +{ + if (match(str.c_str(), this->ipaddr, true)) + return true; + else + return false; +} + +bool QLine::Matches(const std::string &str) +{ + if (match(str.c_str(), this->nick)) + return true; + + return false; +} + |