X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Ffreenet%2Fintroductionpuzzleinserter.cpp;h=1b5b64f359b09b15680ecd282d32f581fbd7891f;hb=c7fcb4c4bc5012a584add81a9509fc1f84c3c688;hp=a4b661746b6028d4ad659366f9faf3f3eb803958;hpb=8adfd604a97d385869b0ce763b35d014d7aa2cca;p=fms.git diff --git a/src/freenet/introductionpuzzleinserter.cpp b/src/freenet/introductionpuzzleinserter.cpp index a4b6617..1b5b64f 100644 --- a/src/freenet/introductionpuzzleinserter.cpp +++ b/src/freenet/introductionpuzzleinserter.cpp @@ -27,11 +27,17 @@ void IntroductionPuzzleInserter::CheckForNeededInsert() while(!rs.AtEnd()) { + std::string localidentityidstr; DateTime now; now.SetToGMTime(); + if(rs.GetField(0)) + { + localidentityidstr=rs.GetField(0); + } + // if this identity has any non-solved puzzles for today, we don't need to insert a new puzzle - SQLite3DB::Recordset rs2=m_db->Query("SELECT UUID FROM tblIntroductionPuzzleInserts WHERE Day='"+now.Format("%Y-%m-%d")+"' AND FoundSolution='false';"); + SQLite3DB::Recordset rs2=m_db->Query("SELECT UUID FROM tblIntroductionPuzzleInserts WHERE Day='"+now.Format("%Y-%m-%d")+"' AND FoundSolution='false' AND LocalIdentityID="+localidentityidstr+";"); // identity doesn't have any non-solved puzzles for today - start a new insert if(rs2.Empty()==true) @@ -217,7 +223,7 @@ void IntroductionPuzzleInserter::StartInsert(const long localidentityid) privatekey=rs2.GetField(0); } - Option::instance()->Get("MessageBase",messagebase); + Option::Instance()->Get("MessageBase",messagebase); GenerateCaptcha(encodedpuzzle,solutionstring);