X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Ffreenet%2Fsiteinserter.cpp;h=7ffee2553f3953c9a1029d06b44cb14ef98fece7;hb=59a5414ec47a2932a7802fcd1d98c4d80166564f;hp=458b71bf9a3890e6bb5ecd6e2df86c32cdb4f9f7;hpb=fcb124f8d6d3f5678e82049fb8e5e23c8cfaec6d;p=fms.git diff --git a/src/freenet/siteinserter.cpp b/src/freenet/siteinserter.cpp index 458b71b..7ffee25 100644 --- a/src/freenet/siteinserter.cpp +++ b/src/freenet/siteinserter.cpp @@ -4,17 +4,18 @@ #include #include #include +#include #ifdef XMEM #include #endif -SiteInserter::SiteInserter() +SiteInserter::SiteInserter(SQLite3DB::DB *db):IIndexInserter(db) { Initialize(); } -SiteInserter::SiteInserter(FCPv2 *fcp):IIndexInserter(fcp) +SiteInserter::SiteInserter(SQLite3DB::DB *db, FCPv2::Connection *fcp):IIndexInserter(db,fcp) { Initialize(); } @@ -44,8 +45,6 @@ std::string SiteInserter::GenerateIndex(const std::string &htmltemplate, const l { std::string content=""; - content+="

My last few posts

"; - SQLite3DB::Statement boardst=m_db->Prepare("SELECT tblBoard.BoardName FROM tblBoard INNER JOIN tblMessageBoard ON tblBoard.BoardID=tblMessageBoard.BoardID WHERE tblMessageBoard.MessageID=? ORDER BY tblBoard.BoardName COLLATE NOCASE;"); SQLite3DB::Statement st=m_db->Prepare("SELECT tblMessage.Body, tblMessage.Subject, tblMessage.MessageID FROM tblMessage INNER JOIN tblIdentity ON tblMessage.IdentityID=tblIdentity.IdentityID INNER JOIN tblLocalIdentity ON tblIdentity.PublicKey=tblLocalIdentity.PublicKey WHERE tblLocalIdentity.LocalIdentityID=? ORDER BY tblMessage.MessageDate DESC, tblMessage.MessageTime DESC LIMIT 0,10;"); st.Bind(0,localidentityid); @@ -277,11 +276,11 @@ std::string SiteInserter::GenerateTrustList(const std::string &htmltemplate, con st.Bind(1,Poco::DateTimeFormatter::format(date,"%Y-%m-%d %H:%M:%S")); st.Step(); - content+=""; - content+="
"; + content+=""; + content+=""; content+="Trust List of "+SanitizeOutput(name); content+=""; - content+=""; + content+=""; while(st.RowReturned()) { std::string idname=""; @@ -317,11 +316,11 @@ std::string SiteInserter::GenerateTrustList(const std::string &htmltemplate, con content+=""; if(freesiteedition!="") { - content+=""; + content+=""; } else { - content+=""; + content+=""; } content+=""; content+=""; @@ -331,6 +330,7 @@ std::string SiteInserter::GenerateTrustList(const std::string &htmltemplate, con st.Step(); } + content+="
Message TrustMessage CommentTrust List TrustTrust Comment
Message TrustMessage CommentTrust List TrustTrust Comment
"+SanitizeOutput(CreateShortIdentityName(idname,publickey))+""+SanitizeOutput(CreateShortIdentityName(idname,publickey))+"
"+SanitizeOutput(CreateShortIdentityName(idname,publickey))+"
"+messagetrust+""+SanitizeOutput(messagetrustcomment)+"
"; return StringFunctions::Replace(htmltemplate,"[CONTENT]",content); @@ -355,7 +355,7 @@ const std::string SiteInserter::GetClassString(const std::string &trustlevel) } } -const bool SiteInserter::HandlePutFailed(FCPMessage &message) +const bool SiteInserter::HandlePutFailed(FCPv2::Message &message) { std::vector idparts; long localidentityid; @@ -370,7 +370,7 @@ const bool SiteInserter::HandlePutFailed(FCPMessage &message) return true; } -const bool SiteInserter::HandlePutSuccessful(FCPMessage &message) +const bool SiteInserter::HandlePutSuccessful(FCPv2::Message &message) { std::vector idparts; std::vector uriparts; @@ -419,7 +419,7 @@ const std::string SiteInserter::SanitizeOutput(const std::string &input) const bool SiteInserter::StartInsert(const long &localidentityid) { - FCPMessage message; + FCPv2::Message message; std::string localidentityidstr=""; std::string sizestr=""; std::string uskkey=""; @@ -451,12 +451,12 @@ const bool SiteInserter::StartInsert(const long &localidentityid) filenum++; } - m_fcp->SendMessage(message); + m_fcp->Send(message); // send data of each page for(std::map::iterator pagei=pages.begin(); pagei!=pages.end(); pagei++) { - m_fcp->SendRaw(&(*pagei).second[0],(*pagei).second.size()); + m_fcp->Send(std::vector((*pagei).second.begin(),(*pagei).second.end())); } m_inserting.push_back(localidentityid);