X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Ffreenet%2Fintroductionpuzzleinserter.cpp;h=0070ec6979b81156e9d7fdd649f72ecb78af41b9;hb=ed0732b2550c23c05fc9faf925620e87ee6dee12;hp=089e4acb4ddbbb1a3c54f406ca5387673135e9ea;hpb=4e96d123460d6363cf7274e36bd9357768eb86ad;p=fms.git diff --git a/src/freenet/introductionpuzzleinserter.cpp b/src/freenet/introductionpuzzleinserter.cpp index 089e4ac..0070ec6 100644 --- a/src/freenet/introductionpuzzleinserter.cpp +++ b/src/freenet/introductionpuzzleinserter.cpp @@ -17,12 +17,12 @@ #include #endif -IntroductionPuzzleInserter::IntroductionPuzzleInserter():IIndexInserter() +IntroductionPuzzleInserter::IntroductionPuzzleInserter(SQLite3DB::DB *db):IIndexInserter(db) { Initialize(); } -IntroductionPuzzleInserter::IntroductionPuzzleInserter(FCPv2::Connection *fcp):IIndexInserter(fcp) +IntroductionPuzzleInserter::IntroductionPuzzleInserter(SQLite3DB::DB *db, FCPv2::Connection *fcp):IIndexInserter(db,fcp) { Initialize(); } @@ -224,7 +224,8 @@ const bool IntroductionPuzzleInserter::StartInsert(const long &localidentityid) } } - Option::Instance()->Get("MessageBase",messagebase); + Option option(m_db); + option.Get("MessageBase",messagebase); GenerateCaptcha(encodedpuzzle,solutionstring); if(encodedpuzzle.size()==0) @@ -260,7 +261,8 @@ const bool IntroductionPuzzleInserter::StartInsert(const long &localidentityid) m_fcp->Send(message); m_fcp->Send(std::vector(xmldata.begin(),xmldata.end())); - // insert to USK + // insert to USK - not used, but don't remove code yet + /* message.Clear(); message.SetName("ClientPutComplexDir"); message["URI"]="USK"+privatekey.substr(3)+messagebase+"|"+Poco::DateTimeFormatter::format(now,"%Y.%m.%d")+"|IntroductionPuzzle/0/"; @@ -271,6 +273,7 @@ const bool IntroductionPuzzleInserter::StartInsert(const long &localidentityid) message["Files.0.DataLength"]=xmldatasizestr; m_fcp->Send(message); m_fcp->Send(std::vector(xmldata.begin(),xmldata.end())); + */ m_db->Execute("INSERT INTO tblIntroductionPuzzleInserts(UUID,Type,MimeType,LocalIdentityID,PuzzleData,PuzzleSolution) VALUES('"+xml.GetUUID()+"','captcha','image/bmp',"+idstring+",'"+encodedpuzzle+"','"+solutionstring+"');");