From 42c6a9282a7e0ba1c4251114150b7cb4bd833c9e Mon Sep 17 00:00:00 2001 From: drbob Date: Sun, 24 Mar 2013 15:56:21 +0000 Subject: [PATCH] fixed up subscribe Macros and fn for channels. git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@6276 b45a01b8-16f6-495d-af2f-9b41ad6348cc --- libretroshare/src/retroshare/rsgxschannels.h | 3 +++ libretroshare/src/retroshare/rsgxsflags.h | 3 +-- libretroshare/src/services/p3gxschannels.cc | 3 +-- libretroshare/src/services/p3gxschannels.h | 2 +- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/libretroshare/src/retroshare/rsgxschannels.h b/libretroshare/src/retroshare/rsgxschannels.h index 009ca0528..1c8a77341 100644 --- a/libretroshare/src/retroshare/rsgxschannels.h +++ b/libretroshare/src/retroshare/rsgxschannels.h @@ -103,6 +103,9 @@ virtual bool getChannelAutoDownload(const RsGxsGroupId &groupid) = 0; //virtual bool groupRestoreKeys(const std::string &groupId); //virtual bool groupShareKeys(const std::string &groupId, std::list& peers); + // Overloaded subscribe fn. +virtual void subscribeToGroup(uint32_t token, const RsGxsGroupId &groupId, bool subscribe) = 0; + virtual bool createGroup(uint32_t &token, RsGxsChannelGroup &group) = 0; virtual bool createPost(uint32_t &token, RsGxsChannelPost &post) = 0; diff --git a/libretroshare/src/retroshare/rsgxsflags.h b/libretroshare/src/retroshare/rsgxsflags.h index 3c6be7256..0a1108d89 100644 --- a/libretroshare/src/retroshare/rsgxsflags.h +++ b/libretroshare/src/retroshare/rsgxsflags.h @@ -117,10 +117,9 @@ namespace GXS_SERV { #define IS_MSG_UNREAD(status) (status & GXS_SERV::GXS_MSG_STATUS_UNREAD) #define IS_GROUP_ADMIN(subscribeFlags) (subscribeFlags & GXS_SERV::GROUP_SUBSCRIBE_ADMIN) #define IS_GROUP_PUBLISHER(subscribeFlags) (subscribeFlags & GXS_SERV::GROUP_SUBSCRIBE_PUBLISH) -#define IS_GROUP_SUBSCRIBED(subscribeFlags) (subscribeFlags & (GXS_SERV::GROUP_SUBSCRIBE_ADMIN | GXS_SERV::GROUP_SUBSCRIBE_SUBSCRIBED)) +#define IS_GROUP_SUBSCRIBED(subscribeFlags) (subscribeFlags & GXS_SERV::GROUP_SUBSCRIBE_SUBSCRIBED) #define IS_GROUP_NOT_SUBSCRIBED(subscribeFlags) (subscribeFlags & GXS_SERV::GROUP_SUBSCRIBE_NOT_SUBSCRIBED) - #define IS_MSG_UNPROCESSED(status) (status & GXS_SERV::GXS_MSG_STATUS_UNPROCESSED) diff --git a/libretroshare/src/services/p3gxschannels.cc b/libretroshare/src/services/p3gxschannels.cc index cbc547c57..578d55b32 100644 --- a/libretroshare/src/services/p3gxschannels.cc +++ b/libretroshare/src/services/p3gxschannels.cc @@ -442,7 +442,7 @@ void p3GxsChannels::clearUnsubscribedGroup(const RsGxsGroupId &id) } -void p3GxsChannels::subscribeToGroup(const RsGxsGroupId &groupId, bool subscribe) +void p3GxsChannels::subscribeToGroup(uint32_t token, const RsGxsGroupId &groupId, bool subscribe) { std::cerr << "p3GxsChannels::subscribedToGroup() id: " << groupId << " subscribe: " << subscribe; std::cerr << std::endl; @@ -451,7 +451,6 @@ void p3GxsChannels::subscribeToGroup(const RsGxsGroupId &groupId, bool subscribe groups.push_back(groupId); // Call down to do the real work. - uint32_t token; RsGenExchange::subscribeToGroup(token, groupId, subscribe); // reload Group afterwards. diff --git a/libretroshare/src/services/p3gxschannels.h b/libretroshare/src/services/p3gxschannels.h index 28d036c65..3fd669265 100644 --- a/libretroshare/src/services/p3gxschannels.h +++ b/libretroshare/src/services/p3gxschannels.h @@ -134,7 +134,7 @@ virtual bool acknowledgeVote(const uint32_t& token, std::pair