]> git.netwichtig.de Git - user/henk/code/inspircd.git/commitdiff
Turn IsIdent into a functor
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>
Wed, 25 Jul 2007 17:21:30 +0000 (17:21 +0000)
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>
Wed, 25 Jul 2007 17:21:30 +0000 (17:21 +0000)
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@7568 e03df62e-2008-0410-955e-edbf42e46eb7

include/inspircd.h
src/helperfuncs.cpp
src/inspircd.cpp

index ba6c2b17439563492ff084ebcb757cef29c25b09..c2ea3f0482192628b8c9d0807681a2fc36e99cbd 100644 (file)
@@ -248,6 +248,15 @@ class CoreExport IsNickHandler : public HandlerBase1<bool, const char*>
        virtual bool Call(const char*);
 };
 
+class CoreExport IsIdentHandler : public HandlerBase1<bool, const char*>
+{
+       InspIRCd* Server;
+ public:
+       IsIdentHandler(InspIRCd* Srv) : Server(Srv) { }
+       virtual ~IsIdentHandler() { }
+       virtual bool Call(const char*);
+};
+
 
 /* Forward declaration - required */
 class XLineManager;
@@ -389,7 +398,9 @@ class CoreExport InspIRCd : public classbase
 
        /**** Functors ****/
 
-       IsNickHandler HandleIsNick;     
+       IsNickHandler HandleIsNick;
+
+       IsIdentHandler HandleIsIdent;
 
        /** InspSocket classes pending deletion after being closed.
         * We don't delete these immediately as this may cause a segmentation fault.
@@ -868,7 +879,7 @@ class CoreExport InspIRCd : public classbase
         * @param An ident to verify
         * @return True if the ident is valid
         */
-       bool IsIdent(const char* n);
+       caller1<bool, const char*> IsIdent;
 
        /** Find a username by their file descriptor.
         * It is preferred to use this over directly accessing the fd_ref_table array.
index 8e6627d1f5c8f35c5c0089c01c9ee3edce787668..b5b2a095bc90f515fbe2758cb631c4e36d1e3b62 100644 (file)
@@ -418,7 +418,7 @@ bool IsNickHandler::Call(const char* n)
 }
 
 /* return true for good ident, false else */
-bool InspIRCd::IsIdent(const char* n)
+bool IsIdentHandler::Call(const char* n)
 {
        if (!n || !*n)
                return false;
index 09f1e868505215d39988f5b12c12dae4a6a18e79..dea2f0a58cbfe9735385a9472181c0fa10035aae 100644 (file)
@@ -394,7 +394,10 @@ void InspIRCd::WritePID(const std::string &filename)
 InspIRCd::InspIRCd(int argc, char** argv)
        : ModCount(0),
          GlobalCulls(this),
-        HandleIsNick(this), IsNick(&HandleIsNick)
+        HandleIsNick(this),
+        HandleIsIdent(this),
+        IsNick(&HandleIsNick),
+        IsIdent(&HandleIsIdent)
 {
        int found_ports = 0;
        FailedPortList pl;