mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-12-15 10:54:22 -05:00
Added ClearFeedItems() function to pqinotify interface.
Clear NewsFeeds after Cache loading so we only see new stuff. git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@2974 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
a5cc8d7ba2
commit
61e8d588a8
@ -195,3 +195,22 @@ bool p3Notify::AddFeedItem(uint32_t type, std::string id1, std::string id2, std:
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
bool p3Notify::ClearFeedItems(uint32_t type)
|
||||||
|
{
|
||||||
|
RsStackMutex stack(noteMtx); /************* LOCK MUTEX ************/
|
||||||
|
|
||||||
|
std::list<RsFeedItem>::iterator it;
|
||||||
|
for(it = pendingNewsFeed.begin(); it != pendingNewsFeed.end(); )
|
||||||
|
{
|
||||||
|
if (it->mType == type)
|
||||||
|
{
|
||||||
|
it = pendingNewsFeed.erase(it);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
it++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
@ -88,6 +88,7 @@ virtual bool AddPopupMessage(uint32_t ptype, std::string name, std::string msg);
|
|||||||
virtual bool AddSysMessage(uint32_t sysid, uint32_t type, std::string title, std::string msg);
|
virtual bool AddSysMessage(uint32_t sysid, uint32_t type, std::string title, std::string msg);
|
||||||
virtual bool AddLogMessage(uint32_t sysid, uint32_t type, std::string title, std::string msg);
|
virtual bool AddLogMessage(uint32_t sysid, uint32_t type, std::string title, std::string msg);
|
||||||
virtual bool AddFeedItem(uint32_t type, std::string id1, std::string id2, std::string id3);
|
virtual bool AddFeedItem(uint32_t type, std::string id1, std::string id2, std::string id3);
|
||||||
|
virtual bool ClearFeedItems(uint32_t type);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
|
@ -44,7 +44,7 @@ virtual bool AddPopupMessage(uint32_t ptype, std::string name, std::string msg)
|
|||||||
virtual bool AddSysMessage(uint32_t sysid, uint32_t type, std::string title, std::string msg) = 0;
|
virtual bool AddSysMessage(uint32_t sysid, uint32_t type, std::string title, std::string msg) = 0;
|
||||||
virtual bool AddLogMessage(uint32_t sysid, uint32_t type, std::string title, std::string msg) = 0;
|
virtual bool AddLogMessage(uint32_t sysid, uint32_t type, std::string title, std::string msg) = 0;
|
||||||
virtual bool AddFeedItem(uint32_t type, std::string id1, std::string id2, std::string id3) = 0;
|
virtual bool AddFeedItem(uint32_t type, std::string id1, std::string id2, std::string id3) = 0;
|
||||||
|
virtual bool ClearFeedItems(uint32_t type) = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
extern pqiNotify *getPqiNotify();
|
extern pqiNotify *getPqiNotify();
|
||||||
|
@ -2208,6 +2208,27 @@ int RsServer::StartupRetroShare()
|
|||||||
/* load caches and secondary data */
|
/* load caches and secondary data */
|
||||||
/**************************************************************************/
|
/**************************************************************************/
|
||||||
|
|
||||||
|
// Clear the News Feeds that are generated by Initial Cache Loading.
|
||||||
|
|
||||||
|
/* Peer stuff is up to date */
|
||||||
|
|
||||||
|
/* Channel/Forum/Blog stuff will all come from Caches */
|
||||||
|
getPqiNotify()->ClearFeedItems(RS_FEED_ITEM_CHAN_NEW);
|
||||||
|
getPqiNotify()->ClearFeedItems(RS_FEED_ITEM_CHAN_UPDATE);
|
||||||
|
getPqiNotify()->ClearFeedItems(RS_FEED_ITEM_CHAN_MSG);
|
||||||
|
|
||||||
|
getPqiNotify()->ClearFeedItems(RS_FEED_ITEM_FORUM_NEW);
|
||||||
|
getPqiNotify()->ClearFeedItems(RS_FEED_ITEM_FORUM_UPDATE);
|
||||||
|
getPqiNotify()->ClearFeedItems(RS_FEED_ITEM_FORUM_MSG);
|
||||||
|
|
||||||
|
getPqiNotify()->ClearFeedItems(RS_FEED_ITEM_BLOG_NEW);
|
||||||
|
getPqiNotify()->ClearFeedItems(RS_FEED_ITEM_BLOG_UPDATE);
|
||||||
|
getPqiNotify()->ClearFeedItems(RS_FEED_ITEM_BLOG_MSG);
|
||||||
|
|
||||||
|
//getPqiNotify()->ClearFeedItems(RS_FEED_ITEM_CHAT_NEW);
|
||||||
|
getPqiNotify()->ClearFeedItems(RS_FEED_ITEM_MESSAGE);
|
||||||
|
//getPqiNotify()->ClearFeedItems(RS_FEED_ITEM_FILES_NEW);
|
||||||
|
|
||||||
|
|
||||||
/**************************************************************************/
|
/**************************************************************************/
|
||||||
/* Force Any Last Configuration Options */
|
/* Force Any Last Configuration Options */
|
||||||
|
Loading…
Reference in New Issue
Block a user