X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Ffreenet%2Fidentityintroductionrequester.cpp;h=0e5e3ddb637d27b5dcd478d81ed8a7ffd7cf2496;hb=175f098e7e712b839db433b93fe8649a402c6784;hp=a474c9cb0f315f8f15262f43421621f71f883109;hpb=d8f51eac91f86a1e00a05a5058a8fa9eb8732464;p=fms.git diff --git a/src/freenet/identityintroductionrequester.cpp b/src/freenet/identityintroductionrequester.cpp index a474c9c..0e5e3dd 100644 --- a/src/freenet/identityintroductionrequester.cpp +++ b/src/freenet/identityintroductionrequester.cpp @@ -82,19 +82,22 @@ const bool IdentityIntroductionRequester::HandleAllData(FCPMessage &message) // we don't already know about this id - add it st.Finalize(); date.SetToGMTime(); - st=m_db->Prepare("INSERT INTO tblIdentity(PublicKey,DateAdded) VALUES(?,?);"); + st=m_db->Prepare("INSERT INTO tblIdentity(PublicKey,DateAdded,AddedMethod) VALUES(?,?,?);"); st.Bind(0,xml.GetIdentity()); st.Bind(1,date.Format("%Y-%m-%d %H:%M:%S")); + st.Bind(2,"solved captcha"); st.Step(); } st.Finalize(); + + m_log->WriteLog(LogFile::LOGLEVEL_DEBUG,"IdentityIntroductionRequester::HandleAddData parsed a valid identity."); } else { - m_log->WriteLog(LogFile::LOGLEVEL_ERROR,__FUNCTION__" parsed public SSK key was not valid."); + m_log->WriteLog(LogFile::LOGLEVEL_ERROR,"IdentityIntroductionRequester::HandleAllData parsed, public SSK key was not valid."); } - m_log->WriteLog(LogFile::LOGLEVEL_DEBUG,__FUNCTION__" parsed IdentityIntroduction XML file : "+message["Identifier"]); + m_log->WriteLog(LogFile::LOGLEVEL_DEBUG,"IdentityIntroductionRequester::HandleAllData parsed IdentityIntroduction XML file : "+message["Identifier"]); } else { @@ -104,7 +107,7 @@ const bool IdentityIntroductionRequester::HandleAllData(FCPMessage &message) st.Step(); st.Finalize(); - m_log->WriteLog(LogFile::LOGLEVEL_ERROR,__FUNCTION__" error parsing IdentityIntroduction XML file : "+message["Identifier"]); + m_log->WriteLog(LogFile::LOGLEVEL_ERROR,"IdentityIntroductionRequester::HandleAllData error parsing IdentityIntroduction XML file : "+message["Identifier"]); } // remove UUID from request list @@ -127,7 +130,7 @@ const bool IdentityIntroductionRequester::HandleGetFailed(FCPMessage &message) st.Step(); st.Finalize(); - m_log->WriteLog(LogFile::LOGLEVEL_DEBUG,__FUNCTION__" Fatal GetFailed for "+message["Identifier"]); + m_log->WriteLog(LogFile::LOGLEVEL_DEBUG,"IdentityIntroductionRequester::HandleAllData Fatal GetFailed for "+message["Identifier"]); } // remove UUID from request list @@ -175,7 +178,7 @@ const bool IdentityIntroductionRequester::HandleMessage(FCPMessage &message) void IdentityIntroductionRequester::Initialize() { std::string tempval=""; - Option::instance()->Get("MaxIdentityIntroductionRequests",tempval); + Option::Instance()->Get("MaxIdentityIntroductionRequests",tempval); StringFunctions::Convert(tempval,m_maxrequests); if(m_maxrequests<1) { @@ -186,7 +189,7 @@ void IdentityIntroductionRequester::Initialize() { m_log->WriteLog(LogFile::LOGLEVEL_WARNING,"Option MaxIdentityIntroductionRequests is currently set at "+tempval+". This value might be incorrectly configured."); } - Option::instance()->Get("MessageBase",m_messagebase); + Option::Instance()->Get("MessageBase",m_messagebase); m_tempdate.SetToGMTime(); } @@ -241,7 +244,7 @@ void IdentityIntroductionRequester::Process() // this will recheck for ids every minute DateTime now; now.SetToGMTime(); - if(m_tempdate<(now-(1.0/1440.0))) + if(m_ids.size()==0 && m_tempdate<(now-(1.0/1440.0))) { PopulateIDList(); m_tempdate=now; @@ -279,7 +282,6 @@ void IdentityIntroductionRequester::StartRequest(const std::string &UUID) st.Bind(0,UUID); st.Step(); - //TODO finish if(st.RowReturned()) { st.ResultText(0,day);