]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
I think this is done. Add overloaded Matches() which takes std::string and implement...
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>
Sun, 28 Oct 2007 20:29:53 +0000 (20:29 +0000)
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>
Sun, 28 Oct 2007 20:29:53 +0000 (20:29 +0000)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@8409 e03df62e-2008-0410-955e-edbf42e46eb7

include/xline.h
src/xline.cpp

index 0fa6e3f5320194b6c81552611b1cbfa1e510a391..9fd4d0beaf3357367f3c8118f88459beff2169e9 100644 (file)
@@ -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;
index a6ed0e6059f780c019216662a1d3066e13144d13..71e94aab7e8d8dfa7248e1f25d7e61c7483329b9 100644 (file)
@@ -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;
+}
+