fixed circle auto-subscribe

This commit is contained in:
csoler 2016-03-13 11:29:21 -04:00
parent a065dba8f8
commit 051806227f
3 changed files with 24 additions and 18 deletions

View File

@ -1153,6 +1153,8 @@ bool RsGenExchange::subscribeToGroup(uint32_t& token, const RsGxsGroupId& grpId,
if(mNetService != NULL)
mNetService->subscribeStatusChanged(grpId,subscribe) ;
else
std::cerr << "(EE) No mNetService in RsGenExchange for service 0x" << std::hex << mServType << std::dec << std::endl;
return true;
}

View File

@ -1355,6 +1355,8 @@ int RsServer::StartupRetroShare()
true,false); // synchronise group automatic
// don't sync messages at all.
mGxsCircles->setNetworkExchangeService(gxscircles_ns) ;
/**** Posted GXS service ****/

View File

@ -37,6 +37,7 @@
/****
* #define DEBUG_CIRCLES 1
****/
#define DEBUG_CIRCLES 1
RsGxsCircles *rsGxsCircles = NULL;
@ -216,14 +217,14 @@ void p3GxsCircles::notifyChanges(std::vector<RsGxsNotify *> &changes)
for(git = groupList.begin(); git != groupList.end(); ++git)
{
#ifdef DEBUG_CIRCLES
std::cerr << "p3GxsCircles::notifyChanges() Incoming Group: " << *git;
std::cerr << std::endl;
std::cerr << "p3GxsCircles::notifyChanges() Incoming Group: " << *git << ". Forcing cache load." << std::endl;
#endif
// for new circles we need to add them to the list.
// we don't know the type of this circle here
// original behavior was to add all ids to the external ids list
addCircleIdToList(RsGxsCircleId(*git), 0);
cache_request_load(RsGxsCircleId(*git)) ;
// reset the cached circle data for this id
{
@ -1265,8 +1266,9 @@ bool p3GxsCircles::checkCircleCacheForAutoSubscribe(RsGxsCircleCache &cache)
uint32_t token, token2;
RsGenExchange::subscribeToGroup(token, RsGxsGroupId(cache.mCircleId.toStdString()), true);
RsGenExchange::setGroupStatusFlags(token2, RsGxsGroupId(cache.mCircleId.toStdString()), 0, GXS_SERV::GXS_GRP_STATUS_UNPROCESSED);
RsGenExchange::subscribeToGroup(token, RsGxsGroupId(cache.mCircleId), true);
RsGenExchange::setGroupStatusFlags(token2, RsGxsGroupId(cache.mCircleId), 0, GXS_SERV::GXS_GRP_STATUS_UNPROCESSED);
cache.mGroupStatus ^= GXS_SERV::GXS_GRP_STATUS_UNPROCESSED;
return true;
}