From 56c870c1d7d0d715b33fb467f17c859b1f195670 Mon Sep 17 00:00:00 2001 From: Gioacchino Mazzurco Date: Sun, 15 Jan 2017 21:45:03 +0100 Subject: [PATCH] Initialize GXS mail service in rsinit.cc forgot in previous commit --- libretroshare/src/rsserver/rsinit.cc | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/libretroshare/src/rsserver/rsinit.cc b/libretroshare/src/rsserver/rsinit.cc index 47036b691..837423d9c 100644 --- a/libretroshare/src/rsserver/rsinit.cc +++ b/libretroshare/src/rsserver/rsinit.cc @@ -82,6 +82,10 @@ #include "tcponudp/udpstunner.h" #endif // RS_USE_DHT_STUNNER +#ifdef RS_GXS_MAIL +# include "services/p3gxsmails.h" +#endif + // #define GPG_DEBUG // #define AUTHSSL_DEBUG // #define FIM_DEBUG @@ -1483,8 +1487,21 @@ int RsServer::StartupRetroShare() pqih->addService(gxschannels_ns, true); //pqih->addService(photo_ns, true); - // remove pword from memory - rsInitConfig->gxs_passwd = ""; +# ifdef RS_GXS_MAIL + RsGeneralDataService* gxsmail_ds = new RsDataService( + currGxsDir + "/", "gxsmails_db", RS_SERVICE_TYPE_GXS_MAIL, + NULL, rsInitConfig->gxs_passwd ); + p3GxsMails* mGxsMails = new p3GxsMails(gxsmail_ds, NULL, mGxsIdService); + RsGxsNetService* gxsmails_ns = new RsGxsNetService( + RS_SERVICE_TYPE_GXS_MAIL, gxschannels_ds, nxsMgr, mGxsMails, + mGxsMails->getServiceInfo(), mGxsIdService, mGxsCircles, + mGxsIdService, pgpAuxUtils ); + mGxsMails->setNetworkExchangeService(gxsmails_ns); + pqih->addService(gxsmails_ns, true); +# endif // RS_GXS_MAIL + + // remove pword from memory + rsInitConfig->gxs_passwd = ""; #endif // RS_ENABLE_GXS. @@ -1804,6 +1821,11 @@ int RsServer::StartupRetroShare() //createThread(*photo_ns); //createThread(*wire_ns); +# ifdef RS_GXS_MAIL + startServiceThread(mGxsMails, "gxs mail"); + startServiceThread(gxsmails_ns, "gxs mail ns"); +# endif // RS_GXS_MAIL + #endif // RS_ENABLE_GXS ftserver->StartupThreads();