Updated the notification system. Main changes are:

- the notification system is now a service, p3Notify, that is a public RsNotify.
- RsNotify does nothing except providing a registration system for new notify clients.
- Clients should derive a notify client from the NotifyClient class and register it to rsNotify
- all registered clients get all notifications, so only derive the needed methods. This should allow 
  plugins to get notifications as well.
- updated the code to call RsServer::notify()->[notification method] from inside libretroshare
- pqiNotify has been removed.



git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@6996 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
csoler 2014-01-07 22:51:22 +00:00
parent 3cc8c144a8
commit 630824aa1b
47 changed files with 482 additions and 484 deletions

View file

@ -1739,7 +1739,6 @@ void RsInit::setAutoLogin(bool autoLogin){
* ft/ code so variable defined here.
*/
RsControl *rsicontrol = NULL;
RsFiles *rsFiles = NULL;
RsTurtle *rsTurtle = NULL ;
#ifdef GROUTER
@ -1852,12 +1851,14 @@ RsGRouter *rsGRouter = NULL ;
#include "services/p3dsdv.h"
#endif
RsControl *createRsControl(NotifyBase &notify)
RsControl *RsControl::instance()
{
RsServer *srv = new RsServer(notify);
rsicontrol = srv;
return srv;
static RsServer *rsicontrol = NULL ;
if(rsicontrol == NULL)
rsicontrol = new RsServer();
return rsicontrol;
}
/*
@ -1921,8 +1922,6 @@ int RsServer::StartupRetroShare()
/**************************************************************************/
std::cerr << "setup classes / structures" << std::endl;
/* History Manager */
mHistoryMgr = new p3HistoryMgr();
mPeerMgr = new p3PeerMgrIMPL( AuthSSL::getAuthSSL()->OwnId(),
@ -1933,7 +1932,6 @@ int RsServer::StartupRetroShare()
mLinkMgr = new p3LinkMgrIMPL(mPeerMgr, mNetMgr);
/* Setup Notify Early - So we can use it. */
rsNotify = new p3Notify();
rsPeers = new p3Peers(mLinkMgr, mPeerMgr, mNetMgr);
mPeerMgr->setManagers(mLinkMgr, mNetMgr);
@ -2128,7 +2126,7 @@ int RsServer::StartupRetroShare()
ftserver->setP3Interface(pqih);
ftserver->setConfigDirectory(RsInitConfig::configDir);
ftserver->SetupFtServer(&(getNotify()));
ftserver->SetupFtServer() ;
CacheStrapper *mCacheStrapper = ftserver->getCacheStrapper();
CacheTransfer *mCacheTransfer = ftserver->getCacheTransfer();
@ -2642,20 +2640,20 @@ int RsServer::StartupRetroShare()
/* 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);
mNotify->ClearFeedItems(RS_FEED_ITEM_CHAN_NEW);
mNotify->ClearFeedItems(RS_FEED_ITEM_CHAN_UPDATE);
mNotify->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);
mNotify->ClearFeedItems(RS_FEED_ITEM_FORUM_NEW);
mNotify->ClearFeedItems(RS_FEED_ITEM_FORUM_UPDATE);
mNotify->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);
mNotify->ClearFeedItems(RS_FEED_ITEM_BLOG_NEW);
mNotify->ClearFeedItems(RS_FEED_ITEM_BLOG_UPDATE);
mNotify->ClearFeedItems(RS_FEED_ITEM_BLOG_MSG);
//getPqiNotify()->ClearFeedItems(RS_FEED_ITEM_CHAT_NEW);
getPqiNotify()->ClearFeedItems(RS_FEED_ITEM_MESSAGE);
mNotify->ClearFeedItems(RS_FEED_ITEM_MESSAGE);
//getPqiNotify()->ClearFeedItems(RS_FEED_ITEM_FILES_NEW);
/* flag that the basic Caches are now in the pending Queues */