Initialize();\r
}\r
\r
-void IdentityInserter::FCPConnected()\r
-{\r
- m_db->Execute("UPDATE tblLocalIdentity SET InsertingIdentity='false';");\r
-}\r
-\r
void IdentityInserter::CheckForNeededInsert()\r
{\r
+ DateTime now;\r
DateTime date;\r
+ now.SetToGMTime();\r
date.SetToGMTime();\r
// set date to 1 hour back\r
date.Add(0,0,-1);\r
\r
+ // Because of importance of Identity.xml, if we are now at the next day we immediately want to insert identities so change the date back to now\r
+ if(date.GetDay()!=now.GetDay())\r
+ {\r
+ date=now;\r
+ }\r
+\r
SQLite3DB::Recordset rs=m_db->Query("SELECT LocalIdentityID FROM tblLocalIdentity WHERE PrivateKey IS NOT NULL AND PrivateKey <> '' AND InsertingIdentity='false' AND (LastInsertedIdentity<'"+date.Format("%Y-%m-%d %H:%M:%S")+"' OR LastInsertedIdentity IS NULL) ORDER BY LastInsertedIdentity;");\r
\r
if(rs.Empty()==false)\r
\r
}\r
\r
+void IdentityInserter::FCPConnected()\r
+{\r
+ m_db->Execute("UPDATE tblLocalIdentity SET InsertingIdentity='false';");\r
+}\r
+\r
+\r
void IdentityInserter::FCPDisconnected()\r
{\r
\r
StringFunctions::Convert(localidentityid,idstring);\r
date.SetToGMTime();\r
\r
- SQLite3DB::Recordset rs=m_db->Query("SELECT Name,PrivateKey,SingleUse FROM tblLocalIdentity WHERE LocalIdentityID="+idstring+";");\r
+ SQLite3DB::Recordset rs=m_db->Query("SELECT Name,PrivateKey,SingleUse,PublishTrustList,PublishBoardList FROM tblLocalIdentity WHERE LocalIdentityID="+idstring+";");\r
\r
if(rs.Empty()==false)\r
{\r
long index=0;\r
std::string indexstr;\r
std::string singleuse="false";\r
+ std::string publishtrustlist="false";\r
+ std::string publishboardlist="false";\r
\r
now.SetToGMTime();\r
\r
}\r
singleuse=="true" ? idxml.SetSingleUse(true) : idxml.SetSingleUse(false);\r
\r
+ if(rs.GetField(3))\r
+ {\r
+ publishtrustlist=rs.GetField(3);\r
+ }\r
+ publishtrustlist=="true" ? idxml.SetPublishTrustList(true) : idxml.SetPublishTrustList(false);\r
+\r
+ if(rs.GetField(4))\r
+ {\r
+ publishboardlist=rs.GetField(3);\r
+ }\r
+ publishboardlist=="true" ? idxml.SetPublishBoardList(true) : idxml.SetPublishBoardList(false);\r
+\r
data=idxml.GetXML();\r
StringFunctions::Convert(data.size(),datasizestr);\r
\r