mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-11 10:35:22 -04:00
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:
parent
3cc8c144a8
commit
630824aa1b
47 changed files with 482 additions and 484 deletions
|
@ -31,6 +31,7 @@
|
|||
//#include "pqi/pqissl.h"
|
||||
|
||||
#include "pqi/p3cfgmgr.h"
|
||||
#include "pqi/p3notify.h"
|
||||
#include "pqi/pqipersongrp.h"
|
||||
|
||||
#include "retroshare/rsiface.h"
|
||||
|
@ -73,27 +74,22 @@ class RsPluginManager;
|
|||
//int InitRetroShare(int argc, char **argv, RsInit *config);
|
||||
//int LoadCertificates(RsInit *config);
|
||||
|
||||
RsControl *createRsControl(NotifyBase ¬ify);
|
||||
|
||||
|
||||
class RsServer: public RsControl, public RsThread
|
||||
{
|
||||
public:
|
||||
/****************************************/
|
||||
/* p3face-startup.cc: init... */
|
||||
virtual int StartupRetroShare();
|
||||
virtual int StartupRetroShare();
|
||||
|
||||
public:
|
||||
/****************************************/
|
||||
/* p3face.cc: main loop / util fns / locking. */
|
||||
|
||||
RsServer(NotifyBase &callback);
|
||||
RsServer() ;
|
||||
virtual ~RsServer();
|
||||
|
||||
/* Thread Fn: Run the Core */
|
||||
virtual void run();
|
||||
|
||||
public: // no longer private:!!!
|
||||
/* locking stuff */
|
||||
void lockRsCore()
|
||||
{
|
||||
|
@ -107,6 +103,8 @@ class RsServer: public RsControl, public RsThread
|
|||
coreMutex.unlock();
|
||||
}
|
||||
|
||||
static p3Notify *notify() { return dynamic_cast<RsServer*>(instance())->mNotify ; }
|
||||
|
||||
private:
|
||||
|
||||
/* mutex */
|
||||
|
@ -186,20 +184,23 @@ class RsServer: public RsControl, public RsThread
|
|||
p3Forums *mForums;
|
||||
/* caches (that need ticking) */
|
||||
|
||||
/* GXS */
|
||||
p3Wiki *mWiki;
|
||||
p3Posted *mPosted;
|
||||
p3PhotoService *mPhoto;
|
||||
p3GxsCircles *mGxsCircles;
|
||||
p3IdService *mGxsIdService;
|
||||
p3GxsForums *mGxsForums;
|
||||
p3GxsChannels *mGxsChannels;
|
||||
p3Wire *mWire;
|
||||
/* GXS */
|
||||
p3Wiki *mWiki;
|
||||
p3Posted *mPosted;
|
||||
p3PhotoService *mPhoto;
|
||||
p3GxsCircles *mGxsCircles;
|
||||
p3IdService *mGxsIdService;
|
||||
p3GxsForums *mGxsForums;
|
||||
p3GxsChannels *mGxsChannels;
|
||||
p3Wire *mWire;
|
||||
|
||||
/* Config */
|
||||
p3ConfigMgr *mConfigMgr;
|
||||
p3GeneralConfig *mGeneralConfig;
|
||||
|
||||
// notify
|
||||
p3Notify *mNotify ;
|
||||
|
||||
// Worker Data.....
|
||||
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue