X-Git-Url: https://git.pterodactylus.net/?p=fms.git;a=blobdiff_plain;f=src%2Ffreenet%2Fidentityinserter.cpp;h=4fac82f0c2d4c96583d6cd6d52da3dc781c5da73;hp=028f49568f30b1c75b74c76d3a99b2a8bff42cde;hb=9048d8e482c91960265f29c2b5b3112f2a52f3d8;hpb=1b0c3b7f86935a772aad271bad4f3d1f37243c2d diff --git a/src/freenet/identityinserter.cpp b/src/freenet/identityinserter.cpp index 028f495..4fac82f 100644 --- a/src/freenet/identityinserter.cpp +++ b/src/freenet/identityinserter.cpp @@ -26,10 +26,13 @@ void IdentityInserter::CheckForNeededInsert() // set date to 1 hour back date.Add(0,0,-1); - // Because of importance of Identity.xml, if we are now at the next day we immediately want to insert identities so change the date back to now + // Because of importance of Identity.xml, if we are now at the next day we immediately want to insert identities so change the date back to 12:00 AM so we find all identities not inserted yet today if(date.GetDay()!=now.GetDay()) { date=now; + date.SetHour(0); + date.SetMinute(0); + date.SetSecond(0); } SQLite3DB::Recordset rs=m_db->Query("SELECT LocalIdentityID FROM tblLocalIdentity WHERE PrivateKey IS NOT NULL AND PrivateKey <> '' AND InsertingIdentity='false' AND (LastInsertedIdentity<'"+date.Format("%Y-%m-%d %H:%M:%S")+"' OR LastInsertedIdentity IS NULL) ORDER BY LastInsertedIdentity;"); @@ -79,7 +82,7 @@ const bool IdentityInserter::HandleMessage(FCPMessage &message) { m_db->Execute("UPDATE tblLocalIdentity SET InsertingIdentity='false', LastInsertedIdentity='"+now.Format("%Y-%m-%d %H:%M:%S")+"' WHERE LocalIdentityID="+idparts[1]+";"); m_db->Execute("INSERT INTO tblLocalIdentityInserts(LocalIdentityID,Day,InsertIndex) VALUES("+idparts[1]+",'"+idparts[4]+"',"+idparts[2]+");"); - m_log->WriteLog(LogFile::LOGLEVEL_DEBUG,__FUNCTION__" inserted identity xml"); + m_log->WriteLog(LogFile::LOGLEVEL_DEBUG,__FUNCTION__" inserted Identity xml"); return true; } @@ -195,7 +198,7 @@ void IdentityInserter::StartInsert(const long localidentityid) if(rs.GetField(4)) { - publishboardlist=rs.GetField(3); + publishboardlist=rs.GetField(4); } publishboardlist=="true" ? idxml.SetPublishBoardList(true) : idxml.SetPublishBoardList(false);