diff --git a/libretroshare/src/libretroshare.pro b/libretroshare/src/libretroshare.pro index cc4e1dc11..ce8b8dff2 100644 --- a/libretroshare/src/libretroshare.pro +++ b/libretroshare/src/libretroshare.pro @@ -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 \ diff --git a/libretroshare/src/rsitems/rswireitems.cc b/libretroshare/src/rsitems/rswireitems.cc index eb3896f17..c00012975 100644 --- a/libretroshare/src/rsitems/rswireitems.cc +++ b/libretroshare/src/rsitems/rswireitems.cc @@ -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") ; diff --git a/libretroshare/src/rsserver/rsinit.cc b/libretroshare/src/rsserver/rsinit.cc index 2de431589..886660049 100644 --- a/libretroshare/src/rsserver/rsinit.cc +++ b/libretroshare/src/rsserver/rsinit.cc @@ -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"); diff --git a/libretroshare/src/services/p3wiki.cc b/libretroshare/src/services/p3wiki.cc index 1d770b5e5..b68aabb9b 100644 --- a/libretroshare/src/services/p3wiki.cc +++ b/libretroshare/src/services/p3wiki.cc @@ -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(*this)) { // Setup of dummy Pages. mAboutActive = false; diff --git a/libretroshare/src/services/p3wire.cc b/libretroshare/src/services/p3wire.cc index fda88f7a2..762a8b8af 100644 --- a/libretroshare/src/services/p3wire.cc +++ b/libretroshare/src/services/p3wire.cc @@ -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(*this)), mWireMtx("WireMtx") { } diff --git a/retroshare-gui/src/gui/MainWindow.cpp b/retroshare-gui/src/gui/MainWindow.cpp index 63a563dc4..3e2bb53dd 100644 --- a/retroshare-gui/src/gui/MainWindow.cpp +++ b/retroshare-gui/src/gui/MainWindow.cpp @@ -103,6 +103,12 @@ #ifdef RS_USE_WIKI #include "gui/WikiPoos/WikiDialog.h" #endif +#ifdef RS_USE_WIRE +#include "gui/TheWire/WireDialog.h" +#endif +#ifdef RS_USE_PHOTO +#include "gui/PhotoShare/PhotoShare.h" +#endif #include "gui/Posted/PostedDialog.h" #include "gui/statistics/StatisticsWindow.h" @@ -423,6 +429,17 @@ void MainWindow::initStackedPage() addPage(wikiDialog = new WikiDialog(ui->stackPages), grp, ¬ify); #endif +#ifdef RS_USE_WIRE + WireDialog *wireDialog = NULL; + addPage(wireDialog = new WireDialog(ui->stackPages), grp, ¬ify); +#endif + +#ifdef RS_USE_PHOTO + PhotoShare *photoDialog = NULL; + addPage(photoDialog = new PhotoShare(ui->stackPages), grp, ¬ify); +#endif + + std::cerr << "Looking for interfaces in existing plugins:" << std::endl; for(int i = 0;inbPlugins();++i) { diff --git a/retroshare-gui/src/gui/PhotoShare/AlbumDialog.cpp b/retroshare-gui/src/gui/PhotoShare/AlbumDialog.cpp index e943d21d7..8961e0cd8 100644 --- a/retroshare-gui/src/gui/PhotoShare/AlbumDialog.cpp +++ b/retroshare-gui/src/gui/PhotoShare/AlbumDialog.cpp @@ -61,7 +61,7 @@ void AlbumDialog::setUp() QPixmap qtn; - GxsIdDetails::loadPixmapFromData(mAlbum.mThumbnail.data, mAlbum.mThumbnail.size, mAlbum.mThumbnail.type.c_str(),qtn); + GxsIdDetails::loadPixmapFromData(mAlbum.mThumbnail.data, mAlbum.mThumbnail.size,qtn, GxsIdDetails::ORIGINAL); if(mAlbum.mThumbnail.size != 0) { diff --git a/retroshare-gui/src/gui/PhotoShare/PhotoShare.h b/retroshare-gui/src/gui/PhotoShare/PhotoShare.h index 9bebcd1c5..dec0e077a 100644 --- a/retroshare-gui/src/gui/PhotoShare/PhotoShare.h +++ b/retroshare-gui/src/gui/PhotoShare/PhotoShare.h @@ -39,6 +39,8 @@ #include "util/TokenQueue.h" #include "PhotoShareItemHolder.h" +#define IMAGE_PHOTO ":/images/lphoto.png" + namespace Ui { class PhotoShare; } @@ -51,6 +53,10 @@ public: PhotoShare(QWidget *parent = 0); ~PhotoShare(); + virtual QIcon iconPixmap() const { return QIcon(IMAGE_PHOTO) ; } + virtual QString pageName() const { return tr("Photo Albums") ; } + virtual QString helpText() const { return ""; } + void notifySelection(PhotoShareItem* selection); private slots: diff --git a/retroshare-gui/src/gui/TheWire/WireDialog.h b/retroshare-gui/src/gui/TheWire/WireDialog.h index 29b25c509..ae948b958 100644 --- a/retroshare-gui/src/gui/TheWire/WireDialog.h +++ b/retroshare-gui/src/gui/TheWire/WireDialog.h @@ -31,6 +31,8 @@ #include "gui/TheWire/PulseItem.h" #include "gui/TheWire/PulseAddDialog.h" +#define IMAGE_WIRE ":/images/kgames.png" + class WireDialog : public MainPage, public PulseHolder { Q_OBJECT @@ -38,6 +40,10 @@ class WireDialog : public MainPage, public PulseHolder public: WireDialog(QWidget *parent = 0); + virtual QIcon iconPixmap() const { return QIcon(IMAGE_WIRE) ; } + virtual QString pageName() const { return tr("The Wire") ; } + virtual QString helpText() const { return ""; } + virtual void deletePulseItem(PulseItem *, uint32_t type); virtual void notifySelection(PulseItem *item, int ptype); diff --git a/retroshare-gui/src/gui/WikiPoos/WikiDialog.cpp b/retroshare-gui/src/gui/WikiPoos/WikiDialog.cpp index a4be2189f..68e1adbb3 100644 --- a/retroshare-gui/src/gui/WikiPoos/WikiDialog.cpp +++ b/retroshare-gui/src/gui/WikiPoos/WikiDialog.cpp @@ -436,8 +436,8 @@ void WikiDialog::requestWikiPage(const RsGxsGrpMsgIdPair &msgId) uint32_t token; GxsMsgReq msgIds; - std::vector &vect_msgIds = msgIds[msgId.first]; - vect_msgIds.push_back(msgId.second); + std::set &set_msgIds = msgIds[msgId.first]; + set_msgIds.insert(msgId.second); mWikiQueue->requestMsgInfo(token, RS_TOKREQ_ANSTYPE_DATA, opts, msgIds, WIKIDIALOG_WIKI_PAGE); } @@ -698,10 +698,10 @@ void WikiDialog::updateDisplay(bool complete) requestGroupMeta(); } else { /* Update all groups of changed messages */ - std::map > msgIds; + std::map > msgIds; getAllMsgIds(msgIds); - std::map >::iterator msgIt; + std::map >::iterator msgIt; for (msgIt = msgIds.begin(); msgIt != msgIds.end(); ++msgIt) { wikiGroupChanged(QString::fromStdString(msgIt->first.toStdString())); } diff --git a/retroshare-gui/src/gui/WikiPoos/WikiEditDialog.cpp b/retroshare-gui/src/gui/WikiPoos/WikiEditDialog.cpp index 2c5fc1b8d..b2f56d2c9 100644 --- a/retroshare-gui/src/gui/WikiPoos/WikiEditDialog.cpp +++ b/retroshare-gui/src/gui/WikiPoos/WikiEditDialog.cpp @@ -622,8 +622,8 @@ void WikiEditDialog::requestPage(const RsGxsGrpMsgIdPair &msgId) opts.mReqType = GXS_REQUEST_TYPE_MSG_DATA; GxsMsgReq msgIds; - std::vector &vect_msgIds = msgIds[msgId.first]; - vect_msgIds.push_back(msgId.second); + std::set &set_msgIds = msgIds[msgId.first]; + set_msgIds.insert(msgId.second); uint32_t token; mWikiQueue->requestMsgInfo(token, RS_TOKREQ_ANSTYPE_DATA, opts, msgIds, WIKIEDITDIALOG_PAGE); diff --git a/retroshare-gui/src/gui/feeds/GxsChannelPostItem.h b/retroshare-gui/src/gui/feeds/GxsChannelPostItem.h index 9955002fa..a067098d9 100644 --- a/retroshare-gui/src/gui/feeds/GxsChannelPostItem.h +++ b/retroshare-gui/src/gui/feeds/GxsChannelPostItem.h @@ -53,7 +53,7 @@ public: //GxsChannelPostItem(FeedHolder *feedHolder, uint32_t feedId, const RsGxsChannelPost &post, bool isHome, bool autoUpdate); virtual ~GxsChannelPostItem(); - uint64_t uniqueIdentifier() const override { hash_64bits("GxsChannelPostItem " + messageId().toStdString()) ; } + uint64_t uniqueIdentifier() const override { return hash_64bits("GxsChannelPostItem " + messageId().toStdString()) ; } bool setGroup(const RsGxsChannelGroup &group, bool doFill = true); bool setPost(const RsGxsChannelPost &post, bool doFill = true); diff --git a/retroshare-gui/src/retroshare-gui.pro b/retroshare-gui/src/retroshare-gui.pro index 59f1cb458..a2254a5f1 100644 --- a/retroshare-gui/src/retroshare-gui.pro +++ b/retroshare-gui/src/retroshare-gui.pro @@ -114,6 +114,11 @@ CONFIG += gxscircles #CONFIG += framecatcher #CONFIG += blogs +## To enable unfinished services +#CONFIG += wikipoos +#CONFIG += gxsthewire +#CONFIG += gxsphotoshare + DEFINES += RS_RELEASE_VERSION RCC_DIR = temp/qrc UI_DIR = temp/ui @@ -342,6 +347,7 @@ openbsd-* { wikipoos { PRE_TARGETDEPS *= $$OUT_PWD/../../supportlibs/pegmarkdown/lib/libpegmarkdown.a LIBS *= $$OUT_PWD/../../supportlibs/pegmarkdown/lib/libpegmarkdown.a + LIBS *= -lglib-2.0 } # Tor controller @@ -1144,7 +1150,8 @@ unfinished_services { gxsphotoshare { - #DEFINES += RS_USE_PHOTOSHARE + #DEFINES += RS_USE_PHOTOSHARE # to enable in unfinished. + DEFINES += RS_USE_PHOTO # enable in MainWindow HEADERS += \ gui/PhotoShare/PhotoDrop.h \ @@ -1189,6 +1196,7 @@ gxsphotoshare { wikipoos { + DEFINES += RS_USE_WIKI DEPENDPATH += ../../supportlibs/pegmarkdown INCLUDEPATH += ../../supportlibs/pegmarkdown @@ -1215,6 +1223,8 @@ wikipoos { gxsthewire { + DEFINES += RS_USE_WIRE + HEADERS += gui/TheWire/PulseItem.h \ gui/TheWire/WireDialog.h \ gui/TheWire/PulseAddDialog.h \