mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-08-03 20:04:20 -04:00
fixes for message clean-up, code now working.
can be enabled with #define GXS_CLEAN_UP, default message store period set to 1 day, cleaned every 3 minutes. Does not comply fully with spec yet (does not use msg not delete flag) git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@6267 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
263c15d6bd
commit
3ed2e471b6
4 changed files with 52 additions and 15 deletions
|
@ -51,13 +51,12 @@ bool RsGxsMessageCleanUp::clean()
|
|||
|
||||
while(!mGrpIds.empty())
|
||||
{
|
||||
|
||||
RsGxsGroupId grpId = mGrpIds.back();
|
||||
mGrpIds.pop_back();
|
||||
GxsMsgReq req;
|
||||
GxsMsgMetaResult result;
|
||||
|
||||
result[grpId] = std::vector<RsGxsMsgMetaData*>();
|
||||
req[grpId] = std::vector<RsGxsMessageId>();
|
||||
mDs->retrieveGxsMsgMetaData(req, result);
|
||||
|
||||
GxsMsgMetaResult::iterator mit = result.begin();
|
||||
|
@ -72,7 +71,7 @@ bool RsGxsMessageCleanUp::clean()
|
|||
for(; vit != metaV.end(); )
|
||||
{
|
||||
RsGxsMsgMetaData* meta = *vit;
|
||||
if(meta->mPublishTs + MESSAGE_STORE_PERIOD > now)
|
||||
if(meta->mPublishTs + MESSAGE_STORE_PERIOD < now)
|
||||
{
|
||||
req[grpId].push_back(meta->mMsgId);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue