+ date=Poco::Timestamp();\r
+ date-=Poco::Timespan(tempint,0,0,0,0);\r
+ st=m_db->Prepare("DELETE FROM tblIdentity WHERE LastSeen<?;");\r
+ st.Bind(0,Poco::DateTimeFormatter::format(date,"%Y-%m-%d %H:%M:%S"));\r
+ st.Step();\r
+ }\r
+ else if((*queryvars.find("formaction")).second=="removenulldaysago" && queryvars.find("daysago")!=queryvars.end() && (*queryvars.find("daysago")).second!="")\r
+ {\r
+ int tempint=10000;\r
+ StringFunctions::Convert((*queryvars.find("daysago")).second,tempint);\r
+ date=Poco::Timestamp();\r
+ date-=Poco::Timespan(tempint,0,0,0,0);\r
+ st=m_db->Prepare("DELETE FROM tblIdentity WHERE LastSeen<? AND LocalMessageTrust IS NULL AND LocalTrustListTrust IS NULL;");\r
+ st.Bind(0,Poco::DateTimeFormatter::format(date,"%Y-%m-%d %H:%M:%S"));\r
+ st.Step();\r
+ }\r
+ else if((*queryvars.find("formaction")).second=="removeposted30daysago")\r
+ {\r
+ date=Poco::Timestamp();\r
+ date-=Poco::Timespan(30,0,0,0,0);\r
+ st=m_db->Prepare("DELETE FROM tblIdentity WHERE IdentityID IN (SELECT tblIdentity.IdentityID FROM tblIdentity INNER JOIN tblMessage ON tblIdentity.IdentityID=tblMessage.IdentityID WHERE (SELECT MAX(MessageDate) FROM tblMessage WHERE tblMessage.IdentityID=tblIdentity.IdentityID)<=? GROUP BY tblIdentity.IdentityID);");\r
+ st.Bind(0,Poco::DateTimeFormatter::format(date,"%Y-%m-%d"));\r
+ st.Step();\r
+ }\r
+ else if((*queryvars.find("formaction")).second=="removeadded20daysneversent")\r
+ {\r
+ date=Poco::Timestamp();\r
+ date-=Poco::Timespan(20,0,0,0,0);\r
+ st=m_db->Prepare("DELETE FROM tblIdentity WHERE IdentityID IN (SELECT tblIdentity.IdentityID FROM tblIdentity LEFT JOIN tblMessage ON tblIdentity.IdentityID=tblMessage.IdentityID WHERE tblMessage.IdentityID IS NULL AND tblIdentity.DateAdded<?);");\r
+ st.Bind(0,Poco::DateTimeFormatter::format(date,"%Y-%m-%d %H:%M:%S"));\r