mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-07-27 00:15:51 -04:00
fixed circle auto-subscribe
This commit is contained in:
parent
a065dba8f8
commit
051806227f
3 changed files with 24 additions and 18 deletions
|
@ -1153,6 +1153,8 @@ bool RsGenExchange::subscribeToGroup(uint32_t& token, const RsGxsGroupId& grpId,
|
||||||
|
|
||||||
if(mNetService != NULL)
|
if(mNetService != NULL)
|
||||||
mNetService->subscribeStatusChanged(grpId,subscribe) ;
|
mNetService->subscribeStatusChanged(grpId,subscribe) ;
|
||||||
|
else
|
||||||
|
std::cerr << "(EE) No mNetService in RsGenExchange for service 0x" << std::hex << mServType << std::dec << std::endl;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1355,6 +1355,8 @@ int RsServer::StartupRetroShare()
|
||||||
true,false); // synchronise group automatic
|
true,false); // synchronise group automatic
|
||||||
// don't sync messages at all.
|
// don't sync messages at all.
|
||||||
|
|
||||||
|
mGxsCircles->setNetworkExchangeService(gxscircles_ns) ;
|
||||||
|
|
||||||
/**** Posted GXS service ****/
|
/**** Posted GXS service ****/
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -37,6 +37,7 @@
|
||||||
/****
|
/****
|
||||||
* #define DEBUG_CIRCLES 1
|
* #define DEBUG_CIRCLES 1
|
||||||
****/
|
****/
|
||||||
|
#define DEBUG_CIRCLES 1
|
||||||
|
|
||||||
RsGxsCircles *rsGxsCircles = NULL;
|
RsGxsCircles *rsGxsCircles = NULL;
|
||||||
|
|
||||||
|
@ -216,14 +217,14 @@ void p3GxsCircles::notifyChanges(std::vector<RsGxsNotify *> &changes)
|
||||||
for(git = groupList.begin(); git != groupList.end(); ++git)
|
for(git = groupList.begin(); git != groupList.end(); ++git)
|
||||||
{
|
{
|
||||||
#ifdef DEBUG_CIRCLES
|
#ifdef DEBUG_CIRCLES
|
||||||
std::cerr << "p3GxsCircles::notifyChanges() Incoming Group: " << *git;
|
std::cerr << "p3GxsCircles::notifyChanges() Incoming Group: " << *git << ". Forcing cache load." << std::endl;
|
||||||
std::cerr << std::endl;
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// for new circles we need to add them to the list.
|
// for new circles we need to add them to the list.
|
||||||
// we don't know the type of this circle here
|
// we don't know the type of this circle here
|
||||||
// original behavior was to add all ids to the external ids list
|
// original behavior was to add all ids to the external ids list
|
||||||
addCircleIdToList(RsGxsCircleId(*git), 0);
|
addCircleIdToList(RsGxsCircleId(*git), 0);
|
||||||
|
cache_request_load(RsGxsCircleId(*git)) ;
|
||||||
|
|
||||||
// reset the cached circle data for this id
|
// reset the cached circle data for this id
|
||||||
{
|
{
|
||||||
|
@ -1265,8 +1266,9 @@ bool p3GxsCircles::checkCircleCacheForAutoSubscribe(RsGxsCircleCache &cache)
|
||||||
|
|
||||||
|
|
||||||
uint32_t token, token2;
|
uint32_t token, token2;
|
||||||
RsGenExchange::subscribeToGroup(token, RsGxsGroupId(cache.mCircleId.toStdString()), true);
|
RsGenExchange::subscribeToGroup(token, RsGxsGroupId(cache.mCircleId), true);
|
||||||
RsGenExchange::setGroupStatusFlags(token2, RsGxsGroupId(cache.mCircleId.toStdString()), 0, GXS_SERV::GXS_GRP_STATUS_UNPROCESSED);
|
RsGenExchange::setGroupStatusFlags(token2, RsGxsGroupId(cache.mCircleId), 0, GXS_SERV::GXS_GRP_STATUS_UNPROCESSED);
|
||||||
|
|
||||||
cache.mGroupStatus ^= GXS_SERV::GXS_GRP_STATUS_UNPROCESSED;
|
cache.mGroupStatus ^= GXS_SERV::GXS_GRP_STATUS_UNPROCESSED;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue