diff --git a/libretroshare/src/services/p3gxscircles.cc b/libretroshare/src/services/p3gxscircles.cc index a65c5db77..5dc52795a 100644 --- a/libretroshare/src/services/p3gxscircles.cc +++ b/libretroshare/src/services/p3gxscircles.cc @@ -207,21 +207,19 @@ void p3GxsCircles::notifyChanges(std::vector &changes) { RsGxsGroupChange *groupChange = dynamic_cast(*it); RsGxsMsgChange *msgChange = dynamic_cast(*it); + if (msgChange && !msgChange->metaChange()) { #ifdef DEBUG_CIRCLES - std::cerr << " Found Message Change Notification"; - std::cerr << std::endl; + std::cerr << " Found circle Message Change Notification" << std::endl; #endif - - std::map > &msgChangeMap = msgChange->msgChangeMap; - std::map >::iterator mit; - for(mit = msgChangeMap.begin(); mit != msgChangeMap.end(); ++mit) + for(std::map >::iterator mit = msgChange->msgChangeMap.begin(); mit != msgChange->msgChangeMap.end(); ++mit) { #ifdef DEBUG_CIRCLES - std::cerr << " Msgs for Group: " << mit->first; - std::cerr << std::endl; + std::cerr << " Msgs for Group: " << mit->first << std::endl; #endif + for(std::map >::const_iterator it2(msgChange->msgChangeMap.begin());it2!=msgChange->msgChangeMap.end();++it2) + force_cache_reload(RsGxsCircleId(it2->first)) ; } } @@ -229,13 +227,9 @@ void p3GxsCircles::notifyChanges(std::vector &changes) if (groupChange && !groupChange->metaChange()) { #ifdef DEBUG_CIRCLES - std::cerr << " Found Group Change Notification"; - std::cerr << std::endl; + std::cerr << " Found Group Change Notification" << std::endl; #endif - - std::list &groupList = groupChange->mGrpIdList; - std::list::iterator git; - for(git = groupList.begin(); git != groupList.end(); ++git) + for(std::list::iterator git = groupChange->mGrpIdList.begin(); git != groupChange->mGrpIdList.end(); ++git) { #ifdef DEBUG_CIRCLES std::cerr << " Incoming Group: " << *git << ". Forcing cache load." << std::endl; @@ -244,6 +238,7 @@ void p3GxsCircles::notifyChanges(std::vector &changes) // 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); // reset the cached circle data for this id @@ -254,14 +249,14 @@ void p3GxsCircles::notifyChanges(std::vector &changes) } } - if(groupChange) - for(std::list::const_iterator git(groupChange->mGrpIdList.begin());git!=groupChange->mGrpIdList.end();++git) - { + if(groupChange) + for(std::list::const_iterator git(groupChange->mGrpIdList.begin());git!=groupChange->mGrpIdList.end();++git) + { #ifdef DEBUG_CIRCLES - std::cerr << " forcing cache loading for circle " << *git << " in order to trigger subscribe update." << std::endl; + std::cerr << " forcing cache loading for circle " << *git << " in order to trigger subscribe update." << std::endl; #endif - force_cache_reload(RsGxsCircleId(*git)) ; - } + force_cache_reload(RsGxsCircleId(*git)) ; + } } RsGxsIfaceHelper::receiveChanges(changes); // this clear up the vector and delete its elements } @@ -2047,5 +2042,3 @@ bool p3GxsCircles::processMembershipRequests(uint32_t token) - -