X-Git-Url: https://git.pterodactylus.net/?p=fms.git;a=blobdiff_plain;f=src%2Ffreenet%2Fperiodicdbmaintenance.cpp;h=f199fd2e04f63842877d388be32ce3a60047d880;hp=caf14abe3d51a9791b53e8d7ffee639784d0ceaf;hb=9b22dd53fe62e312c1647310b7ec43aa127090af;hpb=18b45335ba24f3b6b6d4f4acfe8c5a5ae845ce00 diff --git a/src/freenet/periodicdbmaintenance.cpp b/src/freenet/periodicdbmaintenance.cpp index caf14ab..f199fd2 100644 --- a/src/freenet/periodicdbmaintenance.cpp +++ b/src/freenet/periodicdbmaintenance.cpp @@ -189,6 +189,7 @@ void PeriodicDBMaintenance::Do1DayMaintenance() while(st.RowReturned()) { std::string name=""; + std::string namepart=""; std::string publickey=""; int identityid=0; st.ResultText(0,name); @@ -196,9 +197,19 @@ void PeriodicDBMaintenance::Do1DayMaintenance() std::vector parts; StringFunctions::Split(name,"@",parts); + // name can have a @ in it - so reattach all parts except the last which is the key + for(long i=0; iPrepare("SELECT IdentityID,PublicKey FROM tblIdentity WHERE Name=?;"); - st2.Bind(0,name); + st2.Bind(0,namepart); st2.Step(); while(st2.RowReturned()) { @@ -211,7 +222,7 @@ void PeriodicDBMaintenance::Do1DayMaintenance() // we have the identity - so update the messages table with the identityid st2.ResultInt(0,identityid); - SQLite3DB::Statement st3=m_db->Prepare("UPDATE tblMessage SET IdentityID=? WHERE Name=? AND IdentityID IS NULL;"); + SQLite3DB::Statement st3=m_db->Prepare("UPDATE tblMessage SET IdentityID=? WHERE FromName=? AND IdentityID IS NULL;"); st3.Bind(0,identityid); st3.Bind(1,name); st3.Step();