Fixed the FriendFeed backup of messages:

* switched to one universal PendingCache list.
   * added mHistoricalCaches variable to p3distrib - to indicate when old caches have been loaded.
   * added calls to p3GroupDistrib::HistoricalCachesDone() in rsinit.cc
   * added "historical" parameter to lots of p3distrib functions.
   * updated child classes to only add FeedItems if (historical == false).
   * Switched Validate / Duplicate Msg checks to speed up historical data load.
   * corrected rsrandom function for OSX.
   * bugfix to rsloginhandler function. (compile error).
   


git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@4008 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
drbob 2011-02-02 21:03:46 +00:00
parent 8c35ecdc67
commit 0dcef10ec2
11 changed files with 198 additions and 112 deletions

View file

@ -542,7 +542,7 @@ bool p3Forums::getMessageCount(const std::string &fId, unsigned int &newCount, u
#include "pqi/pqinotify.h"
void p3Forums::locked_notifyGroupChanged(GroupInfo &grp, uint32_t flags)
void p3Forums::locked_notifyGroupChanged(GroupInfo &grp, uint32_t flags, bool historical)
{
const std::string &grpId = grp.grpId;
std::string msgId;
@ -551,11 +551,17 @@ void p3Forums::locked_notifyGroupChanged(GroupInfo &grp, uint32_t flags)
switch(flags)
{
case GRP_NEW_UPDATE:
getPqiNotify()->AddFeedItem(RS_FEED_ITEM_FORUM_NEW, grpId, msgId, nullId);
if (!historical)
{
getPqiNotify()->AddFeedItem(RS_FEED_ITEM_FORUM_NEW, grpId, msgId, nullId);
}
rsicontrol->getNotify().notifyListChange(NOTIFY_LIST_FORUMLIST_LOCKED, NOTIFY_TYPE_ADD);
break;
case GRP_UPDATE:
getPqiNotify()->AddFeedItem(RS_FEED_ITEM_FORUM_UPDATE, grpId, msgId, nullId);
if (!historical)
{
getPqiNotify()->AddFeedItem(RS_FEED_ITEM_FORUM_UPDATE, grpId, msgId, nullId);
}
rsicontrol->getNotify().notifyListChange(NOTIFY_LIST_FORUMLIST_LOCKED, NOTIFY_TYPE_MOD);
break;
case GRP_LOAD_KEY:
@ -570,21 +576,25 @@ void p3Forums::locked_notifyGroupChanged(GroupInfo &grp, uint32_t flags)
rsicontrol->getNotify().notifyListChange(NOTIFY_LIST_FORUMLIST_LOCKED, NOTIFY_TYPE_DEL);
break;
}
return p3GroupDistrib::locked_notifyGroupChanged(grp, flags);
return p3GroupDistrib::locked_notifyGroupChanged(grp, flags, historical);
}
bool p3Forums::locked_eventDuplicateMsg(GroupInfo *grp, RsDistribMsg *msg, std::string id)
bool p3Forums::locked_eventDuplicateMsg(GroupInfo *grp, RsDistribMsg *msg, std::string id, bool historical)
{
return true;
}
bool p3Forums::locked_eventNewMsg(GroupInfo *grp, RsDistribMsg *msg, std::string id)
bool p3Forums::locked_eventNewMsg(GroupInfo *grp, RsDistribMsg *msg, std::string id, bool historical)
{
std::string grpId = msg->grpId;
std::string msgId = msg->msgId;
std::string nullId;
getPqiNotify()->AddFeedItem(RS_FEED_ITEM_FORUM_MSG, grpId, msgId, nullId);
if (!historical)
{
getPqiNotify()->AddFeedItem(RS_FEED_ITEM_FORUM_MSG, grpId, msgId, nullId);
}
return true;
}