diff --git a/libretroshare/src/gxs/gxscoreserver.cc b/libretroshare/src/gxs/gxscoreserver.cc deleted file mode 100644 index 3665551bf..000000000 --- a/libretroshare/src/gxs/gxscoreserver.cc +++ /dev/null @@ -1,77 +0,0 @@ - -/* - * libretroshare/src/gxs: gxscoreserver.cc - * - * General Data service, interface for RetroShare. - * - * Copyright 2011-2011 by Evi-Parker Christopher - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License Version 2 as published by the Free Software Foundation. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 - * USA. - * - * Please report all bugs and problems to "retroshare@lunamutt.com". - * - */ - -#include - -#include "gxscoreserver.h" - -GxsCoreServer::GxsCoreServer() -: mGxsMutex("GxsCoreServer") -{ - -} - -GxsCoreServer::~GxsCoreServer() -{ - - std::set::iterator sit; - - for(sit = mGxsServices.begin(); sit != mGxsServices.end(); sit++) - delete *sit; - -} - - -void GxsCoreServer::run() -{ - std::set::iterator sit; - - double timeDelta = 0.02; - - while(isRunning()) - { - for(sit = mGxsServices.begin(); sit != mGxsServices.end(); sit++) - (*sit)->tick(); - -#ifndef WINDOWS_SYS - usleep((int) (timeDelta * 1000000)); -#else - Sleep((int) (timeDelta * 1000)); -#endif - - } -} - -void GxsCoreServer::addService(RsGxsService* service) -{ - mGxsServices.insert(service); -} - -bool GxsCoreServer::removeService(RsGxsService* service) -{ - return (mGxsServices.erase(service) > 0); -} - diff --git a/libretroshare/src/gxs/gxscoreserver.h b/libretroshare/src/gxs/gxscoreserver.h deleted file mode 100644 index 664a93f8a..000000000 --- a/libretroshare/src/gxs/gxscoreserver.h +++ /dev/null @@ -1,50 +0,0 @@ -#ifndef GXSCORESERVER_H_ -#define GXSCORESERVER_H_ - -/* - * libretroshare/src/gxs: gxscoreserver.h - * - * General Data service, interface for RetroShare. - * - * Copyright 2011-2011 by Evi-Parker Christopher - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License Version 2 as published by the Free Software Foundation. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 - * USA. - * - * Please report all bugs and problems to "retroshare@lunamutt.com". - * - */ - - -#include "util/rsthreads.h" -#include "gxs/rsgxs.h" - -class GxsCoreServer : public RsThread -{ -public: - GxsCoreServer(); - ~GxsCoreServer(); - - void run(); - - void addService(RsGxsService* service); - bool removeService(RsGxsService* service); - -private: - - std::set mGxsServices; - RsMutex mGxsMutex; -}; - -#endif /* GXSCORESERVER_H_ */ diff --git a/libretroshare/src/gxs/rsgenexchange.cc b/libretroshare/src/gxs/rsgenexchange.cc index a8a5fd621..a1b91d421 100644 --- a/libretroshare/src/gxs/rsgenexchange.cc +++ b/libretroshare/src/gxs/rsgenexchange.cc @@ -35,7 +35,7 @@ #include "rsgenexchange.h" #include "gxssecurity.h" #include "util/contentvalue.h" -#include "rsgxsflags.h" +#include "retroshare/rsgxsflags.h" #include "rsgixs.h" @@ -676,6 +676,96 @@ bool RsGenExchange::checkMsgAuthenFlag(const PrivacyBitPos& pos, const uint8_t& } } +void RsGenExchange::receiveChanges(std::vector& changes) +{ + RsStackMutex stack(mGenMtx); + + std::vector::iterator vit = changes.begin(); + + for(; vit != changes.end(); vit++) + { + RsGxsNotify* n = *vit; + RsGxsGroupChange* gc; + RsGxsMsgChange* mc; + if((mc = dynamic_cast(n)) != NULL) + { + mMsgChange.push_back(mc); + } + else if((gc = dynamic_cast(n)) != NULL) + { + mGroupChange.push_back(gc); + } + else + { + delete n; + } + } + +} + +void RsGenExchange::msgsChanged(std::map >& msgs) +{ + RsStackMutex stack(mGenMtx); + + while(!mMsgChange.empty()) + { + RsGxsMsgChange* mc = mMsgChange.back(); + msgs = mc->msgChangeMap; + mMsgChange.pop_back(); + delete mc; + } +} + +void RsGenExchange::groupsChanged(std::list& grpIds) +{ + RsStackMutex stack(mGenMtx); + + while(!mGroupChange.empty()) + { + RsGxsGroupChange* gc = mGroupChange.back(); + std::list& gList = gc->mGrpIdList; + std::list::iterator lit = gList.begin(); + for(; lit != gList.end(); lit++) + grpIds.push_back(*lit); + + mGroupChange.pop_back(); + delete gc; + } +} + +bool RsGenExchange::subscribeToGroup(uint32_t& token, const RsGxsGroupId& grpId, bool subscribe) +{ + if(subscribe) + setGroupSubscribeFlags(token, grpId, GXS_SERV::GROUP_SUBSCRIBE_SUBSCRIBED, GXS_SERV::GROUP_SUBSCRIBE_MASK); + else + setGroupSubscribeFlags(token, grpId, 0, GXS_SERV::GROUP_SUBSCRIBE_MASK); + + return true; +} +bool RsGenExchange::updated(bool willCallGrpChanged, bool willCallMsgChanged) +{ + bool changed = false; + { + RsStackMutex stack(mGenMtx); + + changed = (!mGroupChange.empty() || !mMsgChange.empty()); + } + + if(!willCallGrpChanged) + { + std::list grpIds; + groupsChanged(grpIds); + } + + if(!willCallMsgChanged) + { + std::map > msgs; + msgsChanged(msgs); + } + return changed; +} + bool RsGenExchange::getGroupList(const uint32_t &token, std::list &groupIds) { return mDataAccess->getGroupList(token, groupIds); @@ -1698,7 +1788,7 @@ void RsGenExchange::processRecvdGroups() if(!grpIds.empty()) { RsGxsGroupChange* c = new RsGxsGroupChange(); - c->grpIdList = grpIds; + c->mGrpIdList = grpIds; mNotifications.push_back(c); mDataStore->storeGroup(grps); } diff --git a/libretroshare/src/gxs/rsgenexchange.h b/libretroshare/src/gxs/rsgenexchange.h index 41d3ef1be..164d873b1 100644 --- a/libretroshare/src/gxs/rsgenexchange.h +++ b/libretroshare/src/gxs/rsgenexchange.h @@ -32,6 +32,7 @@ #include "rsgxs.h" #include "rsgds.h" #include "rsnxs.h" +#include "retroshare/rsgxsiface.h" #include "rsgxsdataaccess.h" #include "rsnxsobserver.h" #include "retroshare/rsgxsservice.h" @@ -40,8 +41,7 @@ typedef std::map > GxsMsgDataMap; typedef std::map GxsGroupDataMap; typedef std::map > GxsMsgRelatedDataMap; -typedef std::map > GxsMsgMetaMap; -typedef std::map > GxsMsgRelatedMetaMap; + /*! * This should form the parent class to \n @@ -65,7 +65,7 @@ typedef std::map > GxsMsgRelatedMe class RsGixs; -class RsGenExchange : public RsGxsService, public RsNxsObserver, public RsThread +class RsGenExchange : public RsNxsObserver, public RsThread, public RsGxsIface { public: @@ -112,7 +112,6 @@ public: */ virtual void service_tick() = 0; - /*! * * @return handle to token service handle for making @@ -190,8 +189,51 @@ public: bool getMsgRelatedMeta(const uint32_t &token, GxsMsgRelatedMetaMap& msgMeta); + /*! + * Gxs services should call this for automatic handling of + * changes, send + * @param changes + */ + virtual void receiveChanges(std::vector& changes); + + /*! + * Checks to see if a change has been received for + * for a message or group + * @param willCallGrpChanged if this is set to true, group changed function will return list + * groups that have changed, if false, the group changed list is cleared + * @param willCallMsgChanged if this is set to true, msgChanged function will return map + * messages that have changed, if false, the message changed map is cleared + * @return true if a change has occured for msg or group + * @see groupsChanged + * @see msgsChanged + */ + bool updated(bool willCallGrpChanged = false, bool willCallMsgChanged = false); + + /*! + * The groups changed. \n + * class can reimplement to use to tailor + * the group actually set for ui notification. + * If receivedChanges is not passed RsGxsNotify changes + * this function does nothing + * @param grpIds returns list of grpIds that have changed + * @see updated + */ + void groupsChanged(std::list& grpIds); + + /*! + * The msg changed. \n + * class can reimplement to use to tailor + * the msg actually set for ui notification. + * If receivedChanges is not passed RsGxsNotify changes + * this function does nothing + * @param msgs returns map of message ids that have changed + * @see updated + */ + void msgsChanged(std::map >& msgs); + bool subscribeToGroup(uint32_t& token, const RsGxsGroupId& grpId, bool subscribe); protected: /*! @@ -563,6 +605,8 @@ private: private: std::vector mChanges; + std::vector mGroupChange; + std::vector mMsgChange; }; #endif // RSGENEXCHANGE_H diff --git a/libretroshare/src/gxs/rsgxs.h b/libretroshare/src/gxs/rsgxs.h index 6ef240f6c..e6d786a99 100644 --- a/libretroshare/src/gxs/rsgxs.h +++ b/libretroshare/src/gxs/rsgxs.h @@ -36,25 +36,8 @@ /* data types used throughout Gxs from netservice to genexchange */ -typedef std::map > GxsMsgReq; -typedef std::map > GxsMsgIdResult; typedef std::map > GxsMsgMetaResult; -typedef std::map > MsgMetaResult; typedef std::map > MsgRelatedMetaResult; -typedef std::map > MsgRelatedIdResult; - -class RsGxsService -{ - -public: - - RsGxsService(){} - virtual ~RsGxsService(){} - - virtual void tick() = 0; - -}; - #endif // RSGXS_H diff --git a/libretroshare/src/gxs/rsgxsdata.h b/libretroshare/src/gxs/rsgxsdata.h index 6558d5bbb..c4517808a 100644 --- a/libretroshare/src/gxs/rsgxsdata.h +++ b/libretroshare/src/gxs/rsgxsdata.h @@ -34,7 +34,6 @@ typedef std::string RsGxsGroupId; typedef std::string RsGxsMessageId; -typedef std::pair RsGxsGrpMsgIdPair; class RsGroupMetaData; class RsMsgMetaData; diff --git a/libretroshare/src/gxs/rsgxsifaceimpl.cc b/libretroshare/src/gxs/rsgxsifaceimpl.cc deleted file mode 100644 index b31b9d6af..000000000 --- a/libretroshare/src/gxs/rsgxsifaceimpl.cc +++ /dev/null @@ -1,185 +0,0 @@ - -/* - * libretroshare/src/gxs/rsgxsifaceimpl.cc: rsgxsifaceimpl.cc - * - * RetroShare GXS. - * - * Copyright 2012 by Christopher Evi-Parker - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License Version 2 as published by the Free Software Foundation. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 - * USA. - * - * Please report all bugs and problems to "retroshare@lunamutt.com". - * - */ - -#include "rsgxsifaceimpl.h" -#include "gxs/rsgxs.h" -#include "gxs/rsgxsflags.h" - -RsGxsIfaceImpl::RsGxsIfaceImpl(RsGenExchange *gxs) - : mGxsIfaceMutex("RsGxsIfaceImpl"), mGxs(gxs) -{ -} - - - -void RsGxsIfaceImpl::groupsChanged(std::list &grpIds) -{ - RsStackMutex stack(mGxsIfaceMutex); - - while(!mGroupChange.empty()) - { - RsGxsGroupChange* gc = mGroupChange.back(); - std::list& gList = gc->grpIdList; - std::list::iterator lit = gList.begin(); - for(; lit != gList.end(); lit++) - grpIds.push_back(*lit); - - mGroupChange.pop_back(); - delete gc; - } -} - -bool RsGxsIfaceImpl::updated(bool willCallGrpChanged, bool willCallMsgChanged) -{ - bool changed = false; - { - RsStackMutex stack(mGxsIfaceMutex); - - changed = (!mGroupChange.empty() || !mMsgChange.empty()); - } - - if(!willCallGrpChanged) - { - std::list grpIds; - groupsChanged(grpIds); - } - - if(!willCallMsgChanged) - { - std::map > msgs; - msgsChanged(msgs); - } - - return changed; -} - -void RsGxsIfaceImpl::msgsChanged(std::map > &msgs) -{ - RsStackMutex stack(mGxsIfaceMutex); - - while(!mMsgChange.empty()) - { - RsGxsMsgChange* mc = mMsgChange.back(); - msgs = mc->msgChangeMap; - mMsgChange.pop_back(); - delete mc; - } -} - -void RsGxsIfaceImpl::receiveChanges(std::vector &changes) -{ - - RsStackMutex stack(mGxsIfaceMutex); - - std::vector::iterator vit = changes.begin(); - - for(; vit != changes.end(); vit++) - { - RsGxsNotify* n = *vit; - RsGxsGroupChange* gc; - RsGxsMsgChange* mc; - if((mc = dynamic_cast(n)) != NULL) - { - mMsgChange.push_back(mc); - } - else if((gc = dynamic_cast(n)) != NULL) - { - mGroupChange.push_back(gc); - } - else - { - delete n; - } - } -} - -RsTokenService* RsGxsIfaceImpl::getTokenService() -{ - return mGxs->getTokenService(); -} - -bool RsGxsIfaceImpl::getGroupList(const uint32_t &token, - std::list &groupIds) -{ - - return mGxs->getGroupList(token, groupIds); -} - -bool RsGxsIfaceImpl::getMsgList(const uint32_t &token, - GxsMsgIdResult& msgIds) -{ - - return mGxs->getMsgList(token, msgIds); -} - -bool RsGxsIfaceImpl::getMsgRelatedList(const uint32_t &token, MsgRelatedIdResult &msgIds) -{ - return mGxs->getMsgRelatedList(token, msgIds); -} - -/* Generic Summary */ -bool RsGxsIfaceImpl::getGroupSummary(const uint32_t &token, - std::list &groupInfo) -{ - - return mGxs->getGroupMeta(token, groupInfo); -} - -bool RsGxsIfaceImpl::getMsgSummary(const uint32_t &token, - GxsMsgMetaMap &msgInfo) -{ - - return mGxs->getMsgMeta(token, msgInfo); -} - -bool RsGxsIfaceImpl::getMsgrelatedSummary(const uint32_t &token, GxsMsgRelatedMetaMap &msgInfo) -{ - return mGxs->getMsgRelatedMeta(token, msgInfo); -} - - - -bool RsGxsIfaceImpl::subscribeToGroup(uint32_t& token, const RsGxsGroupId& grpId, bool subscribe) -{ - if(subscribe) - mGxs->setGroupSubscribeFlags(token, grpId, GXS_SERV::GROUP_SUBSCRIBE_SUBSCRIBED, GXS_SERV::GROUP_SUBSCRIBE_MASK); - else - mGxs->setGroupSubscribeFlags(token, grpId, 0, GXS_SERV::GROUP_SUBSCRIBE_MASK); - - return true; -} - - -bool RsGxsIfaceImpl::acknowledgeMsg(const uint32_t& token, std::pair& msgId) -{ - - return mGxs->acknowledgeTokenMsg(token, msgId); -} - -bool RsGxsIfaceImpl::acknowledgeGrp(const uint32_t& token, RsGxsGroupId& grpId) -{ - return mGxs->acknowledgeTokenGrp(token, grpId); -} diff --git a/libretroshare/src/gxs/rsgxsnetservice.cc b/libretroshare/src/gxs/rsgxsnetservice.cc index c78275bdb..2601e413a 100644 --- a/libretroshare/src/gxs/rsgxsnetservice.cc +++ b/libretroshare/src/gxs/rsgxsnetservice.cc @@ -28,7 +28,7 @@ #include #include "rsgxsnetservice.h" -#include "rsgxsflags.h" +#include "retroshare/rsgxsflags.h" /** * #define NXS_NET_DEBUG 1 diff --git a/libretroshare/src/gxs/rstokenservice.h b/libretroshare/src/gxs/rstokenservice.h index c8ccb76a8..e811ddb4c 100644 --- a/libretroshare/src/gxs/rstokenservice.h +++ b/libretroshare/src/gxs/rstokenservice.h @@ -30,8 +30,8 @@ #include #include -#include "serialiser/rsgxsitems.h" -#include "gxs/rsgxs.h" +//#include "gxs/rsgxs.h" +#include "retroshare/rsgxsifacetypes.h" #define GXS_REQUEST_TYPE_GROUP_DATA 0x00010000 #define GXS_REQUEST_TYPE_GROUP_META 0x00020000 @@ -66,8 +66,6 @@ #define RS_TOKREQ_ANSTYPE_ACK 0x0004 - - /*! * This class provides useful generic support for GXS style services. * I expect much of this will be incorporated into the base GXS. diff --git a/libretroshare/src/libretroshare.pro b/libretroshare/src/libretroshare.pro index 32a67664f..d81b22714 100644 --- a/libretroshare/src/libretroshare.pro +++ b/libretroshare/src/libretroshare.pro @@ -238,7 +238,6 @@ win32 { SQLITE_DIR = ../../../sqlite-autoconf-3070900 INCLUDEPATH += $${SQLITE_DIR} } - } @@ -623,7 +622,8 @@ gxs { gxs/rsgxs.h \ gxs/rsdataservice.h \ gxs/rsgxsnetservice.h \ - gxs/rsgxsflags.h \ + retroshare/rsgxsflags.h \ + retroshare/rsgxsifacetypes.h \ gxs/rsgenexchange.h \ gxs/rsnxsobserver.h \ gxs/rsgxsdata.h \ @@ -633,10 +633,10 @@ gxs { serialiser/rsgxsitems.h \ util/retrodb.h \ util/contentvalue.h \ - gxs/gxscoreserver.h \ gxs/gxssecurity.h \ - gxs/rsgxsifaceimpl.h \ + gxs/rsgxsifacehelper.h \ gxs/gxstokenqueue.h \ + gxs/rsgxsiface.h SOURCES += serialiser/rsnxsitems.cc \ @@ -648,9 +648,7 @@ gxs { gxs/rsgxsdataaccess.cc \ util/retrodb.cc \ util/contentvalue.cc \ - gxs/gxscoreserver.cc \ gxs/gxssecurity.cc \ - gxs/rsgxsifaceimpl.cc \ gxs/gxstokenqueue.cc \ # Identity Service diff --git a/libretroshare/src/retroshare/rsgxscircles.h b/libretroshare/src/retroshare/rsgxscircles.h index 8a1134040..42dfb22d4 100644 --- a/libretroshare/src/retroshare/rsgxscircles.h +++ b/libretroshare/src/retroshare/rsgxscircles.h @@ -29,9 +29,10 @@ #include #include #include +#include #include "gxs/rstokenservice.h" -#include "gxs/rsgxsifaceimpl.h" +#include "retroshare/rsgxsifacehelper.h" #include "retroshare/rsidentity.h" @@ -100,12 +101,12 @@ class RsGxsCircleDetails -class RsGxsCircles: public RsGxsIfaceImpl +class RsGxsCircles: public RsGxsIfaceHelper { public: - RsGxsCircles(RsGenExchange *gxs) - :RsGxsIfaceImpl(gxs) { return; } + RsGxsCircles(RsGxsIface *gxs) + :RsGxsIfaceHelper(gxs) { return; } virtual ~RsGxsCircles() { return; } diff --git a/libretroshare/src/gxs/rsgxsflags.h b/libretroshare/src/retroshare/rsgxsflags.h similarity index 96% rename from libretroshare/src/gxs/rsgxsflags.h rename to libretroshare/src/retroshare/rsgxsflags.h index 5236b8e60..90d3b0686 100644 --- a/libretroshare/src/gxs/rsgxsflags.h +++ b/libretroshare/src/retroshare/rsgxsflags.h @@ -16,8 +16,6 @@ */ namespace GXS_SERV { - - /** START privacy **/ static const uint32_t FLAG_PRIVACY_MASK = 0x0000000f; diff --git a/libretroshare/src/retroshare/rsgxsforums.h b/libretroshare/src/retroshare/rsgxsforums.h index af25d869c..92b0f9295 100644 --- a/libretroshare/src/retroshare/rsgxsforums.h +++ b/libretroshare/src/retroshare/rsgxsforums.h @@ -31,7 +31,7 @@ #include #include "gxs/rstokenservice.h" -#include "gxs/rsgxsifaceimpl.h" +#include "retroshare/rsgxsifacehelper.h" @@ -59,12 +59,12 @@ class RsGxsForumMsg std::ostream &operator<<(std::ostream &out, const RsGxsForumGroup &group); std::ostream &operator<<(std::ostream &out, const RsGxsForumMsg &msg); -class RsGxsForums: public RsGxsIfaceImpl +class RsGxsForums: public RsGxsIfaceHelper { public: - RsGxsForums(RsGenExchange *gxs) - :RsGxsIfaceImpl(gxs) { return; } + RsGxsForums(RsGxsIface *gxs) + :RsGxsIfaceHelper(gxs) { return; } virtual ~RsGxsForums() { return; } /* Specific Service Data */ diff --git a/libretroshare/src/retroshare/rsgxsiface.h b/libretroshare/src/retroshare/rsgxsiface.h new file mode 100644 index 000000000..166cd3e6d --- /dev/null +++ b/libretroshare/src/retroshare/rsgxsiface.h @@ -0,0 +1,176 @@ + +/* + * libretroshare/src/gxs/: rsgxsifaceimpl.h + * + * RetroShare GXS. RsGxsIface + * + * Copyright 2012 by Christopher Evi-Parker + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library General Public + * License Version 2 as published by the Free Software Foundation. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Library General Public License for more details. + * + * You should have received a copy of the GNU Library General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 + * USA. + * + * Please report all bugs and problems to "retroshare@lunamutt.com". + * + */ + +#ifndef RSGXSIFACE_H_ +#define RSGXSIFACE_H_ + +#include "retroshare/rsgxsservice.h" +#include "gxs/rsgxsdata.h" +#include "retroshare/rsgxsifacetypes.h" + +/*! + * All implementations must offer thread safety + */ +class RsGxsIface +{ +public: + + virtual ~RsGxsIface(){}; + +public: + + /*! + * Gxs services should call this for automatic handling of + * changes, send + * @param changes + */ + virtual void receiveChanges(std::vector& changes) = 0; + + /*! + * Checks to see if a change has been received for + * for a message or group + * @param willCallGrpChanged if this is set to true, group changed function will return list + * groups that have changed, if false, the group changed list is cleared + * @param willCallMsgChanged if this is set to true, msgChanged function will return map + * messages that have changed, if false, the message changed map is cleared + * @return true if a change has occured for msg or group + * @see groupsChanged + * @see msgsChanged + */ + virtual bool updated(bool willCallGrpChanged = false, bool willCallMsgChanged = false) = 0; + + /*! + * The groups changed. \n + * class can reimplement to use to tailor + * the group actually set for ui notification. + * If receivedChanges is not passed RsGxsNotify changes + * this function does nothing + * @param grpIds returns list of grpIds that have changed + * @see updated + */ + virtual void groupsChanged(std::list& grpIds) = 0; + + /*! + * The msg changed. \n + * class can reimplement to use to tailor + * the msg actually set for ui notification. + * If receivedChanges is not passed RsGxsNotify changes + * this function does nothing + * @param msgs returns map of message ids that have changed + * @see updated + */ + virtual void msgsChanged(std::map >& msgs) = 0; + + /*! + * @return handle to token service for this GXS service + */ + virtual RsTokenService* getTokenService() = 0; + + /* Generic Lists */ + + /*! + * Retrieve list of group ids associated to a request token + * @param token token to be redeemed for this request + * @param groupIds the ids return for given request token + * @return false if request token is invalid, check token status for error report + */ + virtual bool getGroupList(const uint32_t &token, + std::list &groupIds) = 0; + + /*! + * Retrieves list of msg ids associated to a request token + * @param token token to be redeemed for this request + * @param msgIds the ids return for given request token + * @return false if request token is invalid, check token status for error report + */ + virtual bool getMsgList(const uint32_t &token, + GxsMsgIdResult& msgIds) = 0; + + /*! + * Retrieves list of msg related ids associated to a request token + * @param token token to be redeemed for this request + * @param msgIds the ids return for given request token + * @return false if request token is invalid, check token status for error report + */ + virtual bool getMsgRelatedList(const uint32_t &token, + MsgRelatedIdResult& msgIds) = 0; + + /*! + * @param token token to be redeemed for group summary request + * @param groupInfo the ids returned for given request token + * @return false if request token is invalid, check token status for error report + */ + virtual bool getGroupMeta(const uint32_t &token, + std::list &groupInfo) = 0; + + /*! + * @param token token to be redeemed for message summary request + * @param msgInfo the message metadata returned for given request token + * @return false if request token is invalid, check token status for error report + */ + virtual bool getMsgMeta(const uint32_t &token, + GxsMsgMetaMap &msgInfo) = 0; + + /*! + * @param token token to be redeemed for message related summary request + * @param msgInfo the message metadata returned for given request token + * @return false if request token is invalid, check token status for error report + */ + virtual bool getMsgRelatedMeta(const uint32_t &token, + GxsMsgRelatedMetaMap &msgInfo) = 0; + + /*! + * subscribes to group, and returns token which can be used + * to be acknowledged to get group Id + * @param token token to redeem for acknowledgement + * @param grpId the id of the group to subscribe to + */ + virtual bool subscribeToGroup(uint32_t& token, const RsGxsGroupId& grpId, bool subscribe) = 0; + + /*! + * This allows the client service to acknowledge that their msgs has + * been created/modified and retrieve the create/modified msg ids + * @param token the token related to modification/create request + * @param msgIds map of grpid->msgIds of message created/modified + * @return true if token exists false otherwise + */ + virtual bool acknowledgeTokenMsg(const uint32_t& token, std::pair& msgId) = 0; + + /*! + * This allows the client service to acknowledge that their grps has + * been created/modified and retrieve the create/modified grp ids + * @param token the token related to modification/create request + * @param msgIds vector of ids of groups created/modified + * @return true if token exists false otherwise + */ + virtual bool acknowledgeTokenGrp(const uint32_t& token, RsGxsGroupId& grpId) = 0; + +}; + + + +#endif /* RSGXSIFACE_H_ */ diff --git a/libretroshare/src/gxs/rsgxsifaceimpl.h b/libretroshare/src/retroshare/rsgxsifacehelper.h similarity index 74% rename from libretroshare/src/gxs/rsgxsifaceimpl.h rename to libretroshare/src/retroshare/rsgxsifacehelper.h index 93fe0b568..3a05f4642 100644 --- a/libretroshare/src/gxs/rsgxsifaceimpl.h +++ b/libretroshare/src/retroshare/rsgxsifacehelper.h @@ -26,7 +26,8 @@ * */ -#include "gxs/rsgenexchange.h" +#include "retroshare/rsgxsiface.h" +#include "rsgxsflags.h" /*! * The simple idea of this class is to implement the simple interface functions @@ -36,7 +37,7 @@ * - subscription to groups * - retrieval of msgs and group ids and meta info */ -class RsGxsIfaceImpl +class RsGxsIfaceHelper { public: @@ -44,17 +45,21 @@ public: * * @param gxs handle to RsGenExchange instance of service (Usually the service class itself) */ - RsGxsIfaceImpl(RsGenExchange* gxs); + RsGxsIfaceHelper(RsGxsIface* gxs) + : mGxs(gxs) + {} + + ~RsGxsIfaceHelper(){} -protected: /*! * Gxs services should call this for automatic handling of * changes, send * @param changes */ - void receiveChanges(std::vector& changes); - -public: + void receiveChanges(std::vector &changes) + { + mGxs->receiveChanges(changes); + } /*! * Checks to see if a change has been received for @@ -67,7 +72,10 @@ public: * @see groupsChanged * @see msgsChanged */ - virtual bool updated(bool willCallGrpChanged = false, bool willCallMsgChanged = false); + bool updated(bool willCallGrpChanged = false, bool willCallMsgChanged = false) + { + return mGxs->updated(willCallGrpChanged, willCallMsgChanged); + } /*! * The groups changed. \n @@ -78,7 +86,10 @@ public: * @param grpIds returns list of grpIds that have changed * @see updated */ - virtual void groupsChanged(std::list& grpIds); + void groupsChanged(std::list &grpIds) + { + mGxs->groupsChanged(grpIds); + } /*! * The msg changed. \n @@ -89,13 +100,17 @@ public: * @param msgs returns map of message ids that have changed * @see updated */ - virtual void msgsChanged(std::map >& msgs); - + void msgsChanged(std::map > &msgs) + { + mGxs->msgsChanged(msgs); + } /*! * @return handle to token service for this GXS service */ - RsTokenService* getTokenService(); + RsTokenService* getTokenService() + { + return mGxs->getTokenService(); + } /* Generic Lists */ @@ -106,7 +121,10 @@ public: * @return false if request token is invalid, check token status for error report */ bool getGroupList(const uint32_t &token, - std::list &groupIds); + std::list &groupIds) + { + return mGxs->getGroupList(token, groupIds); + } /*! * Retrieves list of msg ids associated to a request token @@ -115,7 +133,10 @@ public: * @return false if request token is invalid, check token status for error report */ bool getMsgList(const uint32_t &token, - GxsMsgIdResult& msgIds); + GxsMsgIdResult& msgIds) + { + return mGxs->getMsgList(token, msgIds); + } /*! * Retrieves list of msg related ids associated to a request token @@ -123,8 +144,10 @@ public: * @param msgIds the ids return for given request token * @return false if request token is invalid, check token status for error report */ - bool getMsgRelatedList(const uint32_t &token, - MsgRelatedIdResult& msgIds); + bool getMsgRelatedList(const uint32_t &token, MsgRelatedIdResult &msgIds) + { + return mGxs->getMsgRelatedList(token, msgIds); + } /*! * @param token token to be redeemed for group summary request @@ -132,7 +155,10 @@ public: * @return false if request token is invalid, check token status for error report */ bool getGroupSummary(const uint32_t &token, - std::list &groupInfo); + std::list &groupInfo) + { + return mGxs->getGroupMeta(token, groupInfo); + } /*! * @param token token to be redeemed for message summary request @@ -140,15 +166,20 @@ public: * @return false if request token is invalid, check token status for error report */ bool getMsgSummary(const uint32_t &token, - GxsMsgMetaMap &msgInfo); + GxsMsgMetaMap &msgInfo) + { + return mGxs->getMsgMeta(token, msgInfo); + } /*! * @param token token to be redeemed for message related summary request * @param msgInfo the message metadata returned for given request token * @return false if request token is invalid, check token status for error report */ - bool getMsgrelatedSummary(const uint32_t &token, - GxsMsgRelatedMetaMap &msgInfo); + bool getMsgrelatedSummary(const uint32_t &token, GxsMsgRelatedMetaMap &msgInfo) + { + return mGxs->getMsgRelatedMeta(token, msgInfo); + } /*! * subscribes to group, and returns token which can be used @@ -156,7 +187,10 @@ public: * @param token token to redeem for acknowledgement * @param grpId the id of the group to subscribe to */ - virtual bool subscribeToGroup(uint32_t& token, const RsGxsGroupId& grpId, bool subscribe); + bool subscribeToGroup(uint32_t& token, const RsGxsGroupId& grpId, bool subscribe) + { + return mGxs->subscribeToGroup(token, grpId, subscribe); + } /*! * This allows the client service to acknowledge that their msgs has @@ -165,7 +199,10 @@ public: * @param msgIds map of grpid->msgIds of message created/modified * @return true if token exists false otherwise */ - bool acknowledgeMsg(const uint32_t& token, std::pair& msgId); + bool acknowledgeMsg(const uint32_t& token, std::pair& msgId) + { + return mGxs->acknowledgeTokenMsg(token, msgId); + } /*! * This allows the client service to acknowledge that their grps has @@ -174,17 +211,14 @@ public: * @param msgIds vector of ids of groups created/modified * @return true if token exists false otherwise */ - bool acknowledgeGrp(const uint32_t& token, RsGxsGroupId& grpId); - + bool acknowledgeGrp(const uint32_t& token, RsGxsGroupId& grpId) + { + return mGxs->acknowledgeTokenGrp(token, grpId); + } private: - RsGenExchange* mGxs; - - std::vector mGroupChange; - std::vector mMsgChange; - - RsMutex mGxsIfaceMutex; + RsGxsIface* mGxs; }; #endif // RSGXSIFACEIMPL_H diff --git a/libretroshare/src/retroshare/rsgxsifacetypes.h b/libretroshare/src/retroshare/rsgxsifacetypes.h new file mode 100644 index 000000000..6e8ae9cf9 --- /dev/null +++ b/libretroshare/src/retroshare/rsgxsifacetypes.h @@ -0,0 +1,125 @@ +/* + * rsgxsifacetypes.h + * + * Created on: 28 Feb 2013 + * Author: crispy + */ + +#ifndef RSGXSIFACETYPES_H_ +#define RSGXSIFACETYPES_H_ + +#include +#include + +typedef std::string RsGxsGroupId; +typedef std::string RsGxsMessageId; + +typedef std::map > GxsMsgIdResult; +typedef std::pair RsGxsGrpMsgIdPair; +typedef std::map > MsgRelatedIdResult; +typedef std::map > GxsMsgReq; + +class RsMsgMetaData; + +typedef std::map > MsgMetaResult; + + +class RsGxsGrpMetaData; +class RsGxsMsgMetaData; + + +class RsGroupMetaData +{ +public: + + RsGroupMetaData() + { + mGroupFlags = 0; + mSubscribeFlags = 0; + + mPop = 0; + mMsgCount = 0; + mLastPost = 0; + + mGroupStatus = 0; + mCircleType = 0; + + //mPublishTs = 0; + } + + void operator =(const RsGxsGrpMetaData& rGxsMeta); + + std::string mGroupId; + std::string mGroupName; + uint32_t mGroupFlags; + uint32_t mSignFlags; // Combination of RSGXS_GROUP_SIGN_PUBLISH_MASK & RSGXS_GROUP_SIGN_AUTHOR_MASK. + + time_t mPublishTs; // Mandatory. + std::string mAuthorId; // Optional. + + // for circles + std::string mCircleId; + uint32_t mCircleType; + + // BELOW HERE IS LOCAL DATA, THAT IS NOT FROM MSG. + + uint32_t mSubscribeFlags; + + uint32_t mPop; // HOW DO WE DO THIS NOW. + uint32_t mMsgCount; // ??? + time_t mLastPost; // ??? + + uint32_t mGroupStatus; + std::string mServiceString; // Service Specific Free-Form extra storage. + std::string mOriginator; + std::string mInternalCircle; +}; + + + + +class RsMsgMetaData +{ + +public: + + RsMsgMetaData() + { + mPublishTs = 0; + mMsgFlags = 0; + + mMsgStatus = 0; + mChildTs = 0; + } + + void operator =(const RsGxsMsgMetaData& rGxsMeta); + + + std::string mGroupId; + std::string mMsgId; + + std::string mThreadId; + std::string mParentId; + std::string mOrigMsgId; + + std::string mAuthorId; + + std::string mMsgName; + time_t mPublishTs; + + /// the first 16 bits for service, last 16 for GXS + uint32_t mMsgFlags; + + // BELOW HERE IS LOCAL DATA, THAT IS NOT FROM MSG. + // normally READ / UNREAD flags. LOCAL Data. + + /// the first 16 bits for service, last 16 for GXS + uint32_t mMsgStatus; + + time_t mChildTs; + std::string mServiceString; // Service Specific Free-Form extra storage. + +}; + + +#endif /* RSGXSIFACETYPES_H_ */ diff --git a/libretroshare/src/retroshare/rsgxsservice.h b/libretroshare/src/retroshare/rsgxsservice.h index d9df811c1..59c09697a 100644 --- a/libretroshare/src/retroshare/rsgxsservice.h +++ b/libretroshare/src/retroshare/rsgxsservice.h @@ -4,6 +4,8 @@ #include "gxs/rstokenservice.h" +typedef std::map > GxsMsgMetaMap; +typedef std::map > GxsMsgRelatedMetaMap; /*! * The aim of this class is to abstract @@ -28,7 +30,7 @@ public: class RsGxsGroupChange : public RsGxsNotify { public: - std::list grpIdList; + std::list mGrpIdList; }; /*! diff --git a/libretroshare/src/retroshare/rsidentity.h b/libretroshare/src/retroshare/rsidentity.h index b5eee52d9..11a933d1d 100644 --- a/libretroshare/src/retroshare/rsidentity.h +++ b/libretroshare/src/retroshare/rsidentity.h @@ -31,7 +31,7 @@ #include #include "gxs/rstokenservice.h" -#include "gxs/rsgxsifaceimpl.h" +#include "retroshare/rsgxsifacehelper.h" /* The Main Interface Class - for information about your Peers */ class RsIdentity; @@ -198,12 +198,12 @@ class RsIdentityParameters }; -class RsIdentity: public RsGxsIfaceImpl +class RsIdentity: public RsGxsIfaceHelper { public: - RsIdentity(RsGenExchange *gxs): RsGxsIfaceImpl(gxs) { return; } + RsIdentity(RsGxsIface *gxs): RsGxsIfaceHelper(gxs) { return; } virtual ~RsIdentity() { return; } /********************************************************************************************/ diff --git a/libretroshare/src/retroshare/rsposted.h b/libretroshare/src/retroshare/rsposted.h index ec6aa6f43..faa17e1d4 100644 --- a/libretroshare/src/retroshare/rsposted.h +++ b/libretroshare/src/retroshare/rsposted.h @@ -31,7 +31,7 @@ #include #include #include "gxs/rstokenservice.h" -#include "gxs/rsgxsifaceimpl.h" +#include "retroshare/rsgxsifacehelper.h" class RsPosted; extern RsPosted *rsPosted; @@ -80,7 +80,7 @@ std::ostream &operator<<(std::ostream &out, const RsPostedComment &comment); -class RsPosted : public RsGxsIfaceImpl +class RsPosted : public RsGxsIfaceHelper { public: @@ -92,7 +92,7 @@ class RsPosted : public RsGxsIfaceImpl static const uint32_t FLAG_MSGTYPE_MASK; - RsPosted(RsGenExchange* gxs) : RsGxsIfaceImpl(gxs) { return; } + RsPosted(RsGxsIface* gxs) : RsGxsIfaceHelper(gxs) { return; } virtual ~RsPosted() { return; } /* Specific Service Data */ diff --git a/libretroshare/src/retroshare/rswiki.h b/libretroshare/src/retroshare/rswiki.h index 7dce2f361..f0c6e4586 100644 --- a/libretroshare/src/retroshare/rswiki.h +++ b/libretroshare/src/retroshare/rswiki.h @@ -31,7 +31,7 @@ #include #include "gxs/rstokenservice.h" -#include "gxs/rsgxsifaceimpl.h" +#include "retroshare/rsgxsifacehelper.h" /* The Main Interface Class - for information about your Peers */ class RsWiki; @@ -113,11 +113,11 @@ std::ostream &operator<<(std::ostream &out, const RsWikiSnapshot &shot); std::ostream &operator<<(std::ostream &out, const RsWikiComment &comment); -class RsWiki: public RsGxsIfaceImpl +class RsWiki: public RsGxsIfaceHelper { public: - RsWiki(RsGenExchange *gxs): RsGxsIfaceImpl(gxs) { return; } + RsWiki(RsGxsIface *gxs): RsGxsIfaceHelper(gxs) { return; } virtual ~RsWiki() { return; } /* Specific Service Data */ diff --git a/libretroshare/src/retroshare/rswire.h b/libretroshare/src/retroshare/rswire.h index d30b496fa..cd0b0b0fe 100644 --- a/libretroshare/src/retroshare/rswire.h +++ b/libretroshare/src/retroshare/rswire.h @@ -31,7 +31,7 @@ #include #include "gxs/rstokenservice.h" -#include "gxs/rsgxsifaceimpl.h" +#include "retroshare/rsgxsifacehelper.h" /* The Main Interface Class - for information about your Peers */ @@ -104,11 +104,11 @@ std::ostream &operator<<(std::ostream &out, const RsWireGroup &group); std::ostream &operator<<(std::ostream &out, const RsWirePulse &pulse); -class RsWire: public RsGxsIfaceImpl +class RsWire: public RsGxsIfaceHelper { public: - RsWire(RsGenExchange *gxs): RsGxsIfaceImpl(gxs) { return; } + RsWire(RsGxsIface *gxs): RsGxsIfaceHelper(gxs) { return; } virtual ~RsWire() { return; } /* Specific Service Data */ diff --git a/libretroshare/src/rsserver/rsinit.cc b/libretroshare/src/rsserver/rsinit.cc index 5025dfdae..b0fddeeb3 100644 --- a/libretroshare/src/rsserver/rsinit.cc +++ b/libretroshare/src/rsserver/rsinit.cc @@ -1805,10 +1805,9 @@ RsTurtle *rsTurtle = NULL ; #ifdef RS_ENABLE_GXS // NEW GXS SYSTEMS. -#include "gxs/gxscoreserver.h" #include "gxs/rsdataservice.h" #include "gxs/rsgxsnetservice.h" -#include "gxs/rsgxsflags.h" +#include "retroshare/rsgxsflags.h" #include "services/p3idservice.h" #include "services/p3gxscircles.h" diff --git a/libretroshare/src/serialiser/rsgxsitems.h b/libretroshare/src/serialiser/rsgxsitems.h index 346cc14a1..635ea9dda 100644 --- a/libretroshare/src/serialiser/rsgxsitems.h +++ b/libretroshare/src/serialiser/rsgxsitems.h @@ -30,108 +30,7 @@ #include "serialiser/rsserial.h" #include "serialiser/rstlvtypes.h" #include "serialiser/rstlvkeys.h" - -class RsGxsGrpMetaData; -class RsGxsMsgMetaData; - - -class RsGroupMetaData -{ -public: - - RsGroupMetaData() - { - mGroupFlags = 0; - mSubscribeFlags = 0; - - mPop = 0; - mMsgCount = 0; - mLastPost = 0; - - mGroupStatus = 0; - mCircleType = 0; - - //mPublishTs = 0; - } - - void operator =(const RsGxsGrpMetaData& rGxsMeta); - - std::string mGroupId; - std::string mGroupName; - uint32_t mGroupFlags; - uint32_t mSignFlags; // Combination of RSGXS_GROUP_SIGN_PUBLISH_MASK & RSGXS_GROUP_SIGN_AUTHOR_MASK. - - time_t mPublishTs; // Mandatory. - std::string mAuthorId; // Optional. - - // for circles - std::string mCircleId; - uint32_t mCircleType; - - // BELOW HERE IS LOCAL DATA, THAT IS NOT FROM MSG. - - uint32_t mSubscribeFlags; - - uint32_t mPop; // HOW DO WE DO THIS NOW. - uint32_t mMsgCount; // ??? - time_t mLastPost; // ??? - - uint32_t mGroupStatus; - std::string mServiceString; // Service Specific Free-Form extra storage. - std::string mOriginator; - std::string mInternalCircle; - - - - - -}; - - - - -class RsMsgMetaData -{ - -public: - - RsMsgMetaData() - { - mPublishTs = 0; - mMsgFlags = 0; - - mMsgStatus = 0; - mChildTs = 0; - } - - void operator =(const RsGxsMsgMetaData& rGxsMeta); - - - std::string mGroupId; - std::string mMsgId; - - std::string mThreadId; - std::string mParentId; - std::string mOrigMsgId; - - std::string mAuthorId; - - std::string mMsgName; - time_t mPublishTs; - - /// the first 16 bits for service, last 16 for GXS - uint32_t mMsgFlags; - - // BELOW HERE IS LOCAL DATA, THAT IS NOT FROM MSG. - // normally READ / UNREAD flags. LOCAL Data. - - /// the first 16 bits for service, last 16 for GXS - uint32_t mMsgStatus; - - time_t mChildTs; - std::string mServiceString; // Service Specific Free-Form extra storage. - -}; +#include "retroshare/rsgxsifacetypes.h" std::ostream &operator<<(std::ostream &out, const RsGroupMetaData &meta); std::ostream &operator<<(std::ostream &out, const RsMsgMetaData &meta); diff --git a/libretroshare/src/serialiser/rsposteditems.cc b/libretroshare/src/serialiser/rsposteditems.cc index 3b8269628..fa6aef754 100644 --- a/libretroshare/src/serialiser/rsposteditems.cc +++ b/libretroshare/src/serialiser/rsposteditems.cc @@ -26,6 +26,7 @@ #include "serialiser/rsposteditems.h" #include "rsbaseserial.h" +#include "rstlvbase.h" uint32_t RsGxsPostedSerialiser::size(RsItem *item) diff --git a/libretroshare/src/services/p3gxscircles.cc b/libretroshare/src/services/p3gxscircles.cc index 24ed09784..973e6aaff 100644 --- a/libretroshare/src/services/p3gxscircles.cc +++ b/libretroshare/src/services/p3gxscircles.cc @@ -25,7 +25,7 @@ #include "services/p3gxscircles.h" #include "serialiser/rsgxscircleitems.h" -#include "gxs/rsgxsflags.h" +#include "retroshare/rsgxsflags.h" #include "util/rsrandom.h" #include "util/rsstring.h" @@ -173,7 +173,7 @@ void p3GxsCircles::notifyChanges(std::vector &changes) std::cerr << "p3GxsCircles::notifyChanges()"; std::cerr << std::endl; - receiveChanges(changes); + RsGxsIfaceHelper::receiveChanges(changes); // for new circles we need to add them to the list. // TODO. diff --git a/libretroshare/src/services/p3gxsforums.cc b/libretroshare/src/services/p3gxsforums.cc index 292663def..4d24754b5 100644 --- a/libretroshare/src/services/p3gxsforums.cc +++ b/libretroshare/src/services/p3gxsforums.cc @@ -29,7 +29,7 @@ #include -#include "gxs/rsgxsflags.h" +#include "retroshare/rsgxsflags.h" #include // For Dummy Msgs. @@ -82,7 +82,7 @@ uint32_t p3GxsForums::forumsAuthenPolicy() } void p3GxsForums::notifyChanges(std::vector &changes) { - receiveChanges(changes); + RsGxsIfaceHelper::receiveChanges(changes); } void p3GxsForums::service_tick() diff --git a/libretroshare/src/services/p3idservice.cc b/libretroshare/src/services/p3idservice.cc index 6fcbcb192..3fb30ae3a 100644 --- a/libretroshare/src/services/p3idservice.cc +++ b/libretroshare/src/services/p3idservice.cc @@ -25,7 +25,7 @@ #include "services/p3idservice.h" #include "serialiser/rsgxsiditems.h" -#include "gxs/rsgxsflags.h" +#include "retroshare/rsgxsflags.h" #include "util/rsrandom.h" #include "util/rsstring.h" @@ -158,7 +158,7 @@ void p3IdService::notifyChanges(std::vector &changes) std::cerr << "p3IdService::notifyChanges()"; std::cerr << std::endl; - receiveChanges(changes); + RsGxsIfaceHelper::receiveChanges(changes); } /********************************************************************************/ diff --git a/libretroshare/src/services/p3photoservice.cc b/libretroshare/src/services/p3photoservice.cc index 483dceb9b..373db8b28 100644 --- a/libretroshare/src/services/p3photoservice.cc +++ b/libretroshare/src/services/p3photoservice.cc @@ -1,6 +1,6 @@ #include "p3photoservice.h" #include "serialiser/rsphotoitems.h" -#include "gxs/rsgxsflags.h" +#include "retroshare/rsgxsflags.h" RsPhoto *rsPhoto = NULL; @@ -136,7 +136,7 @@ void p3PhotoService::groupsChanged(std::list& grpIds) while(!mGroupChange.empty()) { RsGxsGroupChange* gc = mGroupChange.back(); - std::list& gList = gc->grpIdList; + std::list& gList = gc->mGrpIdList; std::list::iterator lit = gList.begin(); for(; lit != gList.end(); lit++) grpIds.push_back(*lit); diff --git a/libretroshare/src/services/p3posted.cc b/libretroshare/src/services/p3posted.cc index e6644d8d8..6d56414b4 100644 --- a/libretroshare/src/services/p3posted.cc +++ b/libretroshare/src/services/p3posted.cc @@ -5,7 +5,7 @@ #include #include "p3posted.h" -#include "gxs/rsgxsflags.h" +#include "retroshare/rsgxsflags.h" #include "serialiser/rsposteditems.h" #define UPDATE_PHASE_GRP_REQUEST 1 @@ -58,7 +58,7 @@ p3Posted::p3Posted(RsGeneralDataService *gds, RsNetworkExchangeService *nes) void p3Posted::notifyChanges(std::vector &changes) { - receiveChanges(changes); + RsGxsIfaceHelper::receiveChanges(changes); } void p3Posted::service_tick() diff --git a/libretroshare/src/services/p3wiki.cc b/libretroshare/src/services/p3wiki.cc index f85431c01..7772ba736 100644 --- a/libretroshare/src/services/p3wiki.cc +++ b/libretroshare/src/services/p3wiki.cc @@ -24,7 +24,7 @@ */ #include "services/p3wiki.h" -#include "gxs/rsgxsflags.h" +#include "retroshare/rsgxsflags.h" #include "serialiser/rswikiitems.h" #include "util/rsrandom.h" @@ -110,7 +110,7 @@ void p3Wiki::notifyChanges(std::vector& changes) std::cerr << "p3Wiki::notifyChanges() New stuff"; std::cerr << std::endl; - receiveChanges(changes); + RsGxsIfaceHelper::receiveChanges(changes); } /* Specific Service Data */ diff --git a/libretroshare/src/services/p3wire.cc b/libretroshare/src/services/p3wire.cc index a25fe9112..722ee7866 100644 --- a/libretroshare/src/services/p3wire.cc +++ b/libretroshare/src/services/p3wire.cc @@ -52,7 +52,7 @@ void p3Wire::notifyChanges(std::vector& changes) std::cerr << "p3Wire::notifyChanges() New stuff"; std::cerr << std::endl; - receiveChanges(changes); + RsGxsIfaceHelper::receiveChanges(changes); } /* Specific Service Data */ diff --git a/libretroshare/src/tests/gxs/genexchangetester.cpp b/libretroshare/src/tests/gxs/genexchangetester.cpp index 203b57bc0..a3d4daaf4 100644 --- a/libretroshare/src/tests/gxs/genexchangetester.cpp +++ b/libretroshare/src/tests/gxs/genexchangetester.cpp @@ -1,7 +1,7 @@ #include "genexchangetester.h" #include "support.h" #include "gxs/rsdataservice.h" -#include "gxs/rsgxsflags.h" +#include "retroshare/rsgxsflags.h" #define TEST_FLAG 0x00004; #define TEST_MASK 0x0000f; diff --git a/libretroshare/src/tests/gxs/genexchangetestservice.h b/libretroshare/src/tests/gxs/genexchangetestservice.h index 60fa0488b..a9d64ac0e 100644 --- a/libretroshare/src/tests/gxs/genexchangetestservice.h +++ b/libretroshare/src/tests/gxs/genexchangetestservice.h @@ -2,7 +2,7 @@ #define GENEXCHANGETESTSERVICE_H #include "gxs/rsgenexchange.h" -#include "gxs/rsgxsifaceimpl.h" +#include "retroshare/rsgxsifacehelper.h" #include "rsdummyservices.h" class GenExchangeTestService : public RsGenExchange diff --git a/libretroshare/src/tests/gxs/nxstestscenario.cc b/libretroshare/src/tests/gxs/nxstestscenario.cc index 73a720c36..c4cf5c666 100644 --- a/libretroshare/src/tests/gxs/nxstestscenario.cc +++ b/libretroshare/src/tests/gxs/nxstestscenario.cc @@ -7,7 +7,7 @@ #include "nxstestscenario.h" #include "gxs/rsdataservice.h" -#include "gxs/rsgxsflags.h" +#include "retroshare/rsgxsflags.h" #include "data_support.h" #include diff --git a/retroshare-gui/src/gui/GxsForumsDialog.cpp b/retroshare-gui/src/gui/GxsForumsDialog.cpp index 3f421f7c9..162c40bc4 100644 --- a/retroshare-gui/src/gui/GxsForumsDialog.cpp +++ b/retroshare-gui/src/gui/GxsForumsDialog.cpp @@ -33,7 +33,7 @@ #include "notifyqt.h" // These should be in retroshare/ folder. -#include "gxs/rsgxsflags.h" +#include "retroshare/rsgxsflags.h" //#define DEBUG_FORUMS diff --git a/retroshare-gui/src/gui/Identity/IdDialog.cpp b/retroshare-gui/src/gui/Identity/IdDialog.cpp index a3a4a69a9..f8639399d 100644 --- a/retroshare-gui/src/gui/Identity/IdDialog.cpp +++ b/retroshare-gui/src/gui/Identity/IdDialog.cpp @@ -25,7 +25,7 @@ #include #include -#include "gxs/rsgxsflags.h" +#include "retroshare/rsgxsflags.h" #include #include diff --git a/retroshare-gui/src/gui/PhotoShare/AlbumCreateDialog.cpp b/retroshare-gui/src/gui/PhotoShare/AlbumCreateDialog.cpp index dc287b466..ce1e68453 100644 --- a/retroshare-gui/src/gui/PhotoShare/AlbumCreateDialog.cpp +++ b/retroshare-gui/src/gui/PhotoShare/AlbumCreateDialog.cpp @@ -4,7 +4,7 @@ #include "ui_AlbumCreateDialog.h" #include "util/misc.h" -#include "gxs/rsgxsflags.h" +#include "retroshare/rsgxsflags.h" AlbumCreateDialog::AlbumCreateDialog(TokenQueue *photoQueue, RsPhoto *rs_photo, QWidget *parent): QDialog(parent, Qt::WindowSystemMenuHint | Qt::WindowTitleHint | Qt::WindowMinMaxButtonsHint | Qt::WindowCloseButtonHint), diff --git a/retroshare-gui/src/gui/PhotoShare/AlbumDialog.cpp b/retroshare-gui/src/gui/PhotoShare/AlbumDialog.cpp index 7d20fffeb..7d3248ffa 100644 --- a/retroshare-gui/src/gui/PhotoShare/AlbumDialog.cpp +++ b/retroshare-gui/src/gui/PhotoShare/AlbumDialog.cpp @@ -2,7 +2,7 @@ #include "AlbumDialog.h" #include "ui_AlbumDialog.h" -#include "gxs/rsgxsflags.h" +#include "retroshare/rsgxsflags.h" AlbumDialog::AlbumDialog(const RsPhotoAlbum& album, TokenQueue* photoQueue, RsPhoto* rs_Photo, QWidget *parent) : QDialog(parent, Qt::WindowSystemMenuHint | Qt::WindowTitleHint | Qt::WindowMinMaxButtonsHint | Qt::WindowCloseButtonHint), diff --git a/retroshare-gui/src/gui/PhotoShare/PhotoShare.cpp b/retroshare-gui/src/gui/PhotoShare/PhotoShare.cpp index 3fd0f2527..8ea3ad861 100644 --- a/retroshare-gui/src/gui/PhotoShare/PhotoShare.cpp +++ b/retroshare-gui/src/gui/PhotoShare/PhotoShare.cpp @@ -27,7 +27,7 @@ #include #include -#include +#include #include #include diff --git a/retroshare-gui/src/gui/Posted/PostedListDialog.cpp b/retroshare-gui/src/gui/Posted/PostedListDialog.cpp index 036ecfa2e..80d9ae9d0 100644 --- a/retroshare-gui/src/gui/Posted/PostedListDialog.cpp +++ b/retroshare-gui/src/gui/Posted/PostedListDialog.cpp @@ -28,7 +28,7 @@ #include "gui/Posted/PostedDialog.h" #include -#include +#include #include #include diff --git a/retroshare-gui/src/gui/WikiPoos/WikiDialog.cpp b/retroshare-gui/src/gui/WikiPoos/WikiDialog.cpp index b780f9e21..610476efd 100644 --- a/retroshare-gui/src/gui/WikiPoos/WikiDialog.cpp +++ b/retroshare-gui/src/gui/WikiPoos/WikiDialog.cpp @@ -34,7 +34,7 @@ #include // These should be in retroshare/ folder. -#include "gxs/rsgxsflags.h" +#include "retroshare/rsgxsflags.h" #include diff --git a/retroshare-gui/src/gui/gxs/GxsGroupDialog.cpp b/retroshare-gui/src/gui/gxs/GxsGroupDialog.cpp index 3f3e34a61..4520d2089 100644 --- a/retroshare-gui/src/gui/gxs/GxsGroupDialog.cpp +++ b/retroshare-gui/src/gui/gxs/GxsGroupDialog.cpp @@ -24,7 +24,7 @@ #include "util/misc.h" #include "GxsGroupDialog.h" #include "gui/common/PeerDefs.h" -#include "gxs/rsgxsflags.h" +#include "retroshare/rsgxsflags.h" #include @@ -331,7 +331,7 @@ void GxsGroupDialog::createGroup() std::cerr << std::endl; QString name = misc::removeNewLine(ui.groupName->text()); - uint32_t flags = 0; + uint32_t flags = GXS_SERV::FLAG_PRIVACY_PUBLIC; if(name.isEmpty()) { diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp index eda9c29a9..d6666e14d 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp +++ b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp @@ -40,9 +40,10 @@ #include #include // These should be in retroshare/ folder. -#include "gxs/rsgxsflags.h" +#include "retroshare/rsgxsflags.h" #include +#include #define DEBUG_FORUMS diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumsFillThread.cpp b/retroshare-gui/src/gui/gxsforums/GxsForumsFillThread.cpp index 7892b993c..bb97eb99a 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumsFillThread.cpp +++ b/retroshare-gui/src/gui/gxsforums/GxsForumsFillThread.cpp @@ -25,10 +25,11 @@ #include "GxsForumsFillThread.h" #include "GxsForumThreadWidget.h" -#include "gxs/rsgxsflags.h" +#include "retroshare/rsgxsflags.h" #include #include +#include #define DEBUG_FORUMS diff --git a/retroshare-gui/src/util/RsGxsUpdateBroadcast.cpp b/retroshare-gui/src/util/RsGxsUpdateBroadcast.cpp index 1813577ac..a95727ca5 100644 --- a/retroshare-gui/src/util/RsGxsUpdateBroadcast.cpp +++ b/retroshare-gui/src/util/RsGxsUpdateBroadcast.cpp @@ -3,7 +3,7 @@ #include "RsGxsUpdateBroadcast.h" -RsGxsUpdateBroadcast::RsGxsUpdateBroadcast(RsGxsIfaceImpl *ifaceImpl, float dt, QObject *parent) : +RsGxsUpdateBroadcast::RsGxsUpdateBroadcast(RsGxsIfaceHelper *ifaceImpl, float dt, QObject *parent) : QObject(parent), mIfaceImpl(ifaceImpl), mDt(dt) { } diff --git a/retroshare-gui/src/util/RsGxsUpdateBroadcast.h b/retroshare-gui/src/util/RsGxsUpdateBroadcast.h index d464491a5..34cde357b 100644 --- a/retroshare-gui/src/util/RsGxsUpdateBroadcast.h +++ b/retroshare-gui/src/util/RsGxsUpdateBroadcast.h @@ -3,13 +3,13 @@ #include -#include +#include class RsGxsUpdateBroadcast : public QObject { Q_OBJECT public: - explicit RsGxsUpdateBroadcast(RsGxsIfaceImpl* ifaceImpl, float dt, QObject *parent = 0); + explicit RsGxsUpdateBroadcast(RsGxsIfaceHelper* ifaceImpl, float dt, QObject *parent = 0); void startMonitor(); void update(); @@ -26,7 +26,7 @@ public slots: private: - RsGxsIfaceImpl* mIfaceImpl; + RsGxsIfaceHelper* mIfaceImpl; float mDt; };