update code to get Wiki / Wire and PhotoShare compiling again

This commit is contained in:
drbob 2020-02-10 22:24:47 +11:00
parent a9f24c85a0
commit d748278637
12 changed files with 105 additions and 27 deletions

View file

@ -20,6 +20,11 @@ DESTDIR = lib
#QMAKE_CFLAGS += -Werror
#QMAKE_CXXFLAGS += -Werror
## Uncomment to enable Unfinished Services.
#CONFIG += wikipoos
#CONFIG += gxsthewire
#CONFIG += gxsphotoshare
debug {
# DEFINES *= DEBUG
# DEFINES *= OPENDHT_DEBUG DHT_DEBUG CONN_DEBUG DEBUG_UDP_SORTER P3DISC_DEBUG DEBUG_UDP_LAYER FT_DEBUG EXTADDRSEARCH_DEBUG
@ -763,6 +768,8 @@ SOURCES += services/p3gxschannels.cc \
rsitems/rsgxschannelitems.cc \
wikipoos {
DEFINES *= RS_USE_WIKI
# Wiki Service
HEADERS += retroshare/rswiki.h \
services/p3wiki.h \
@ -773,6 +780,8 @@ wikipoos {
}
gxsthewire {
DEFINES *= RS_USE_WIRE
# Wire Service
HEADERS += retroshare/rswire.h \
services/p3wire.h \
@ -793,6 +802,8 @@ SOURCES += services/p3postbase.cc \
rsitems/rsposteditems.cc
gxsphotoshare {
DEFINES *= RS_USE_PHOTO
#Photo Service
HEADERS += services/p3photoservice.h \
retroshare/rsphoto.h \

View file

@ -51,6 +51,12 @@ void RsGxsWireGroupItem::serial_process(RsGenericSerializer::SerializeJob j,RsGe
RsTypeSerializer::serial_process(j,ctx,TLV_TYPE_STR_DESCR,group.mDescription,"group.mDescription") ;
}
void RsGxsWirePulseItem::clear()
{
pulse.mPulseText.clear();
pulse.mHashTags.clear();
}
void RsGxsWirePulseItem::serial_process(RsGenericSerializer::SerializeJob j,RsGenericSerializer::SerializeContext& ctx)
{
RsTypeSerializer::serial_process(j,ctx,TLV_TYPE_STR_MSG,pulse.mPulseText,"pulse.mPulseText") ;

View file

@ -737,12 +737,13 @@ RsGRouter *rsGRouter = NULL ;
#include "pgp/pgpauxutils.h"
#include "services/p3idservice.h"
#include "services/p3gxscircles.h"
#include "services/p3wiki.h"
#include "services/p3posted.h"
#include "services/p3photoservice.h"
#include "services/p3gxsforums.h"
#include "services/p3gxschannels.h"
#include "services/p3wiki.h"
#include "services/p3wire.h"
#include "services/p3photoservice.h"
#endif // RS_ENABLE_GXS
@ -1361,35 +1362,35 @@ int RsServer::StartupRetroShare()
mGxsChannels->setNetworkExchangeService(gxschannels_ns) ;
#if 0 // PHOTO IS DISABLED FOR THE MOMENT
#ifdef RS_USE_PHOTO
/**** Photo service ****/
RsGeneralDataService* photo_ds = new RsDataService(currGxsDir + "/", "photoV2_db",
RS_SERVICE_GXS_TYPE_PHOTO, NULL, rsInitConfig->gxs_passwd);
// init gxs services
mPhoto = new p3PhotoService(photo_ds, NULL, mGxsIdService);
p3PhotoService *mPhoto = new p3PhotoService(photo_ds, NULL, mGxsIdService);
// create GXS photo service
RsGxsNetService* photo_ns = new RsGxsNetService(
RS_SERVICE_GXS_TYPE_PHOTO, photo_ds, nxsMgr,
mPhoto, mPhoto->getServiceInfo(),
mGxsIdService, mGxsCircles,mGxsIdService,
mReputations, mGxsCircles,mGxsIdService,
pgpAuxUtils);
#endif
#if 0 // WIRE IS DISABLED FOR THE MOMENT
#ifdef RS_USE_WIRE
/**** Wire GXS service ****/
RsGeneralDataService* wire_ds = new RsDataService(currGxsDir + "/", "wire_db",
RS_SERVICE_GXS_TYPE_WIRE,
NULL, rsInitConfig->gxs_passwd);
mWire = new p3Wire(wire_ds, NULL, mGxsIdService);
p3Wire *mWire = new p3Wire(wire_ds, NULL, mGxsIdService);
// create GXS photo service
RsGxsNetService* wire_ns = new RsGxsNetService(
RS_SERVICE_GXS_TYPE_WIRE, wire_ds, nxsMgr,
mWire, mWire->getServiceInfo(),
mGxsIdService, mGxsCircles,mGxsIdService,
mReputations, mGxsCircles,mGxsIdService,
pgpAuxUtils);
#endif
// now add to p3service
@ -1401,7 +1402,12 @@ int RsServer::StartupRetroShare()
#endif
pqih->addService(gxsforums_ns, true);
pqih->addService(gxschannels_ns, true);
//pqih->addService(photo_ns, true);
#ifdef RS_USE_PHOTO
pqih->addService(photo_ns, true);
#endif
#ifdef RS_USE_WIRE
pqih->addService(wire_ns, true);
#endif
# ifdef RS_GXS_TRANS
RsGeneralDataService* gxstrans_ds = new RsDataService(
@ -1630,8 +1636,12 @@ int RsServer::StartupRetroShare()
#ifdef RS_USE_WIKI
mConfigMgr->addConfiguration("wiki.cfg", wiki_ns);
#endif
//mConfigMgr->addConfiguration("photo.cfg", photo_ns);
//mConfigMgr->addConfiguration("wire.cfg", wire_ns);
#ifdef RS_USE_PHOTO
mConfigMgr->addConfiguration("photo.cfg", photo_ns);
#endif
#ifdef RS_USE_WIRE
mConfigMgr->addConfiguration("wire.cfg", wire_ns);
#endif
#endif //RS_ENABLE_GXS
mConfigMgr->addConfiguration("I2PBOB.cfg", mI2pBob);
@ -1793,8 +1803,12 @@ int RsServer::StartupRetroShare()
rsGxsChannels = mGxsChannels;
rsGxsTrans = mGxsTrans;
//rsPhoto = mPhoto;
//rsWire = mWire;
#if RS_USE_PHOTO
rsPhoto = mPhoto;
#endif
#if RS_USE_WIRE
rsWire = mWire;
#endif
/*** start up GXS core runner ***/
@ -1808,8 +1822,12 @@ int RsServer::StartupRetroShare()
startServiceThread(mGxsForums, "gxs forums");
startServiceThread(mGxsChannels, "gxs channels");
//createThread(*mPhoto);
//createThread(*mWire);
#if RS_USE_PHOTO
startServiceThread(mPhoto, "gxs photo");
#endif
#if RS_USE_WIRE
startServiceThread(mPhoto, "gxs wire");
#endif
// cores ready start up GXS net servers
startServiceThread(gxsid_ns, "gxs id ns");
@ -1821,8 +1839,12 @@ int RsServer::StartupRetroShare()
startServiceThread(gxsforums_ns, "gxs forums ns");
startServiceThread(gxschannels_ns, "gxs channels ns");
//createThread(*photo_ns);
//createThread(*wire_ns);
#if RS_USE_PHOTO
startServiceThread(photo_ns, "gxs photo ns");
#endif
#if RS_USE_WIRE
startServiceThread(photo_ns, "gxs wire ns");
#endif
# ifdef RS_GXS_TRANS
startServiceThread(mGxsTrans, "gxs trans");

View file

@ -40,7 +40,7 @@ RsWiki *rsWiki = NULL;
p3Wiki::p3Wiki(RsGeneralDataService* gds, RsNetworkExchangeService* nes, RsGixs *gixs)
:RsGenExchange(gds, nes, new RsGxsWikiSerialiser(), RS_SERVICE_GXS_TYPE_WIKI, gixs, wikiAuthenPolicy()),
RsWiki(this)
RsWiki(static_cast<RsGxsIface&>(*this))
{
// Setup of dummy Pages.
mAboutActive = false;

View file

@ -33,7 +33,7 @@ RsWire *rsWire = NULL;
p3Wire::p3Wire(RsGeneralDataService* gds, RsNetworkExchangeService* nes, RsGixs *gixs)
:RsGenExchange(gds, nes, new RsGxsWireSerialiser(), RS_SERVICE_GXS_TYPE_WIRE, gixs, wireAuthenPolicy()),
RsWire(this), mWireMtx("WireMtx")
RsWire(static_cast<RsGxsIface&>(*this)), mWireMtx("WireMtx")
{
}