version 0.2.2
[fms.git] / src / freenet / identityintroductionrequester.cpp
index 9fee644..0e5e3dd 100644 (file)
@@ -82,16 +82,19 @@ const bool IdentityIntroductionRequester::HandleAllData(FCPMessage &message)
                                // we don't already know about this id - add it\r
                                st.Finalize();\r
                                date.SetToGMTime();\r
-                               st=m_db->Prepare("INSERT INTO tblIdentity(PublicKey,DateAdded) VALUES(?,?);");\r
+                               st=m_db->Prepare("INSERT INTO tblIdentity(PublicKey,DateAdded,AddedMethod) VALUES(?,?,?);");\r
                                st.Bind(0,xml.GetIdentity());\r
                                st.Bind(1,date.Format("%Y-%m-%d %H:%M:%S"));\r
+                               st.Bind(2,"solved captcha");\r
                                st.Step();\r
                        }\r
                        st.Finalize();\r
+\r
+                       m_log->WriteLog(LogFile::LOGLEVEL_DEBUG,"IdentityIntroductionRequester::HandleAddData parsed a valid identity.");\r
                }\r
                else\r
                {\r
-                       m_log->WriteLog(LogFile::LOGLEVEL_ERROR,"IdentityIntroductionRequester::HandleAllData parsed public SSK key was not valid.");\r
+                       m_log->WriteLog(LogFile::LOGLEVEL_ERROR,"IdentityIntroductionRequester::HandleAllData parsed, public SSK key was not valid.");\r
                }\r
 \r
                m_log->WriteLog(LogFile::LOGLEVEL_DEBUG,"IdentityIntroductionRequester::HandleAllData parsed IdentityIntroduction XML file : "+message["Identifier"]);\r
@@ -175,7 +178,7 @@ const bool IdentityIntroductionRequester::HandleMessage(FCPMessage &message)
 void IdentityIntroductionRequester::Initialize()\r
 {\r
        std::string tempval="";\r
-       Option::instance()->Get("MaxIdentityIntroductionRequests",tempval);\r
+       Option::Instance()->Get("MaxIdentityIntroductionRequests",tempval);\r
        StringFunctions::Convert(tempval,m_maxrequests);\r
        if(m_maxrequests<1)\r
        {\r
@@ -186,7 +189,7 @@ void IdentityIntroductionRequester::Initialize()
        {\r
                m_log->WriteLog(LogFile::LOGLEVEL_WARNING,"Option MaxIdentityIntroductionRequests is currently set at "+tempval+".  This value might be incorrectly configured.");\r
        }\r
-       Option::instance()->Get("MessageBase",m_messagebase);\r
+       Option::Instance()->Get("MessageBase",m_messagebase);\r
        m_tempdate.SetToGMTime();\r
 }\r
 \r
@@ -241,7 +244,7 @@ void IdentityIntroductionRequester::Process()
        // this will recheck for ids every minute\r
        DateTime now;\r
        now.SetToGMTime();\r
-       if(m_tempdate<(now-(1.0/1440.0)))\r
+       if(m_ids.size()==0 && m_tempdate<(now-(1.0/1440.0)))\r
        {\r
                PopulateIDList();\r
                m_tempdate=now;\r