X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Ffreenet%2Ftrustlistinserter.cpp;h=79745ee53e072f6969af538edf19e2363af263aa;hb=5c0453c8697cfaa843dd7f799e5404733ee56e13;hp=5f2fbb8fb394d8f3deab05186d18844533b594cc;hpb=b9c3763a932cebaa015a27fe111017f6f34dfbaa;p=fms.git diff --git a/src/freenet/trustlistinserter.cpp b/src/freenet/trustlistinserter.cpp index 5f2fbb8..79745ee 100644 --- a/src/freenet/trustlistinserter.cpp +++ b/src/freenet/trustlistinserter.cpp @@ -136,21 +136,39 @@ void TrustListInserter::StartInsert(const long localidentityid, const std::strin int index; std::string indexstr; std::string localidentityidstr; + std::string messagetrustcomment=""; + std::string trustlisttrustcomment=""; now.SetToGMTime(); date.SetToGMTime(); // build the xml file - we only want to add identities that we recently saw, otherwise we could be inserting a ton of identities date.Add(0,0,0,-20); // identities seen in last 20 days - SQLite3DB::Statement st=m_db->Prepare("SELECT PublicKey, LocalMessageTrust, LocalTrustListTrust FROM tblIdentity WHERE PublicKey IS NOT NULL AND PublicKey<>'' AND LastSeen>=?;"); + SQLite3DB::Statement st=m_db->Prepare("SELECT PublicKey, LocalMessageTrust, LocalTrustListTrust, MessageTrustComment, TrustListTrustComment FROM tblIdentity WHERE PublicKey IS NOT NULL AND PublicKey<>'' AND LastSeen>=?;"); st.Bind(0,date.Format("%Y-%m-%d")); st.Step(); while(st.RowReturned()) { st.ResultText(0,publickey); - st.ResultInt(1,messagetrust); - st.ResultInt(2,trustlisttrust); - xml.AddTrust(publickey,messagetrust,trustlisttrust); + if(st.ResultNull(1)==false) + { + st.ResultInt(1,messagetrust); + } + else + { + messagetrust=-1; + } + if(st.ResultNull(2)==false) + { + st.ResultInt(2,trustlisttrust); + } + else + { + trustlisttrust=-1; + } + st.ResultText(3,messagetrustcomment); + st.ResultText(4,trustlisttrustcomment); + xml.AddTrust(publickey,messagetrust,trustlisttrust,messagetrustcomment,trustlisttrustcomment); st.Step(); }