mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-02 22:25:04 -04:00
Adding Basics of GxsChannel Service into libretroshare.
This includes a generic CommentService, which will be used by other Services. + Bugfix, gxs service threads were started before global variables were set. git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@6186 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
99c5633a63
commit
22782e5edd
17 changed files with 2326 additions and 66 deletions
|
@ -51,6 +51,7 @@ const int p3facemsgzone = 11453;
|
|||
#include "services/p3posted.h"
|
||||
#include "services/p3photoservice.h"
|
||||
#include "services/p3gxsforums.h"
|
||||
#include "services/p3gxschannels.h"
|
||||
#include "services/p3wire.h"
|
||||
|
||||
#endif
|
||||
|
@ -160,6 +161,7 @@ void RsServer::rsGlobalShutDown()
|
|||
#ifdef RS_ENABLE_GXS
|
||||
if(mGxsCircles) mGxsCircles->join();
|
||||
if(mGxsForums) mGxsForums->join();
|
||||
if(mGxsChannels) mGxsChannels->join();
|
||||
if(mGxsIdService) mGxsIdService->join();
|
||||
if(mPosted) mPosted->join();
|
||||
if(mPhoto) mPhoto->join();
|
||||
|
|
|
@ -51,6 +51,7 @@
|
|||
class p3IdService;
|
||||
class p3GxsCircles;
|
||||
class p3GxsForums;
|
||||
class p3GxsChannels;
|
||||
class p3Wiki;
|
||||
class p3Posted;
|
||||
class p3PhotoService;
|
||||
|
@ -192,6 +193,7 @@ class RsServer: public RsControl, public RsThread
|
|||
p3GxsCircles *mGxsCircles;
|
||||
p3IdService *mGxsIdService;
|
||||
p3GxsForums *mGxsForums;
|
||||
p3GxsChannels *mGxsChannels;
|
||||
p3Wire *mWire;
|
||||
|
||||
/* Config */
|
||||
|
|
|
@ -1815,6 +1815,7 @@ RsTurtle *rsTurtle = NULL ;
|
|||
#include "services/p3posted.h"
|
||||
#include "services/p3photoservice.h"
|
||||
#include "services/p3gxsforums.h"
|
||||
#include "services/p3gxschannels.h"
|
||||
#include "services/p3wire.h"
|
||||
|
||||
#endif // RS_ENABLE_GXS
|
||||
|
@ -2261,7 +2262,7 @@ int RsServer::StartupRetroShare()
|
|||
//
|
||||
mPluginsManager->registerClientServices(pqih) ;
|
||||
mPluginsManager->registerCacheServices() ;
|
||||
//#define RS_ENABLE_GXS
|
||||
|
||||
#ifdef RS_ENABLE_GXS
|
||||
|
||||
// The idea is that if priorGxsDir is non
|
||||
|
@ -2431,23 +2432,20 @@ int RsServer::StartupRetroShare()
|
|||
RS_SERVICE_GXSV1_TYPE_FORUMS, gxsforums_ds, nxsMgr, mGxsForums);
|
||||
|
||||
|
||||
/*** start up GXS core runner ***/
|
||||
createThread(*mGxsIdService);
|
||||
createThread(*mGxsCircles);
|
||||
createThread(*mPhoto);
|
||||
createThread(*mPosted);
|
||||
createThread(*mWiki);
|
||||
createThread(*mWire);
|
||||
createThread(*mGxsForums);
|
||||
/**** Channel GXS service ****/
|
||||
|
||||
// cores ready start up GXS net servers
|
||||
createThread(*gxsid_ns);
|
||||
createThread(*gxscircles_ns);
|
||||
createThread(*photo_ns);
|
||||
createThread(*posted_ns);
|
||||
createThread(*wiki_ns);
|
||||
createThread(*wire_ns);
|
||||
createThread(*gxsforums_ns);
|
||||
RsGeneralDataService* gxschannels_ds = new RsDataService(currGxsDir + "/", "gxschannels_db",
|
||||
RS_SERVICE_GXSV1_TYPE_CHANNELS);
|
||||
|
||||
//#ifndef GXS_DEV_TESTNET // NO RESET, OR DUMMYDATA for TESTNET
|
||||
gxschannels_ds->resetDataStore(); //TODO: remove, new service data per RS session, for testing
|
||||
//#endif
|
||||
|
||||
mGxsChannels = new p3GxsChannels(gxschannels_ds, NULL, mGxsIdService);
|
||||
|
||||
// create GXS photo service
|
||||
RsGxsNetService* gxschannels_ns = new RsGxsNetService(
|
||||
RS_SERVICE_GXSV1_TYPE_CHANNELS, gxschannels_ds, nxsMgr, mGxsChannels);
|
||||
|
||||
// now add to p3service
|
||||
pqih->addService(gxsid_ns);
|
||||
|
@ -2456,6 +2454,7 @@ int RsServer::StartupRetroShare()
|
|||
pqih->addService(posted_ns);
|
||||
pqih->addService(wiki_ns);
|
||||
pqih->addService(gxsforums_ns);
|
||||
pqih->addService(gxschannels_ns);
|
||||
|
||||
#endif // RS_ENABLE_GXS.
|
||||
|
||||
|
@ -2676,6 +2675,41 @@ int RsServer::StartupRetroShare()
|
|||
/* Start up Threads */
|
||||
/**************************************************************************/
|
||||
|
||||
#ifdef RS_ENABLE_GXS
|
||||
|
||||
// Must Set the GXS pointers before starting threads.
|
||||
rsIdentity = mGxsIdService;
|
||||
rsGxsCircles = mGxsCircles;
|
||||
rsWiki = mWiki;
|
||||
rsPosted = mPosted;
|
||||
rsPhoto = mPhoto;
|
||||
rsGxsForums = mGxsForums;
|
||||
rsGxsChannels = mGxsChannels;
|
||||
rsWire = mWire;
|
||||
|
||||
/*** start up GXS core runner ***/
|
||||
createThread(*mGxsIdService);
|
||||
createThread(*mGxsCircles);
|
||||
createThread(*mPhoto);
|
||||
createThread(*mPosted);
|
||||
createThread(*mWiki);
|
||||
createThread(*mWire);
|
||||
createThread(*mGxsForums);
|
||||
createThread(*mGxsChannels);
|
||||
|
||||
// cores ready start up GXS net servers
|
||||
createThread(*gxsid_ns);
|
||||
createThread(*gxscircles_ns);
|
||||
createThread(*photo_ns);
|
||||
createThread(*posted_ns);
|
||||
createThread(*wiki_ns);
|
||||
createThread(*wire_ns);
|
||||
createThread(*gxsforums_ns);
|
||||
createThread(*gxschannels_ns);
|
||||
|
||||
|
||||
#endif // RS_ENABLE_GXS
|
||||
|
||||
ftserver->StartupThreads();
|
||||
ftserver->ResumeTransfers();
|
||||
|
||||
|
@ -2715,17 +2749,6 @@ int RsServer::StartupRetroShare()
|
|||
rsForums = mForums;
|
||||
rsChannels = mChannels;
|
||||
|
||||
#ifdef RS_ENABLE_GXS
|
||||
|
||||
rsIdentity = mGxsIdService;
|
||||
rsGxsCircles = mGxsCircles;
|
||||
rsWiki = mWiki;
|
||||
rsPosted = mPosted;
|
||||
rsPhoto = mPhoto;
|
||||
rsGxsForums = mGxsForums;
|
||||
rsWire = mWire;
|
||||
|
||||
#endif // RS_ENABLE_GXS
|
||||
|
||||
|
||||
#ifdef RS_USE_BLOGS
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue