X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Ffreenet%2Fidentityintroductionrequester.cpp;h=0e5e3ddb637d27b5dcd478d81ed8a7ffd7cf2496;hb=175f098e7e712b839db433b93fe8649a402c6784;hp=9fee644b0490124f95ca07fe65478c4d78aba43e;hpb=8adfd604a97d385869b0ce763b35d014d7aa2cca;p=fms.git diff --git a/src/freenet/identityintroductionrequester.cpp b/src/freenet/identityintroductionrequester.cpp index 9fee644..0e5e3dd 100644 --- a/src/freenet/identityintroductionrequester.cpp +++ b/src/freenet/identityintroductionrequester.cpp @@ -82,16 +82,19 @@ 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,"IdentityIntroductionRequester::HandleAllData 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,"IdentityIntroductionRequester::HandleAllData parsed IdentityIntroduction XML file : "+message["Identifier"]); @@ -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;