diff --git a/libretroshare/src/gxs/rsgxsnetservice.cc b/libretroshare/src/gxs/rsgxsnetservice.cc index 8a0b26e0d..0c387afa2 100644 --- a/libretroshare/src/gxs/rsgxsnetservice.cc +++ b/libretroshare/src/gxs/rsgxsnetservice.cc @@ -266,7 +266,7 @@ static const uint32_t RS_NXS_ITEM_ENCRYPTION_STATUS_GXS_KEY_MISSING = 0x05 ; || defined(NXS_NET_DEBUG_4) || defined(NXS_NET_DEBUG_5) || defined(NXS_NET_DEBUG_6) || defined(NXS_NET_DEBUG_7) static const RsPeerId peer_to_print = RsPeerId(std::string("")) ; -static const RsGxsGroupId group_id_to_print = RsGxsGroupId(std::string("30501fac090b65f5b9def169598b53ed" )) ; // use this to allow to this group id only, or "" for all IDs +static const RsGxsGroupId group_id_to_print = RsGxsGroupId(std::string("")) ; // use this to allow to this group id only, or "" for all IDs static const uint32_t service_to_print = 0x211 ; // use this to allow to this service id only, or 0 for all services // warning. Numbers should be SERVICE IDS (see serialiser/rsserviceids.h. E.g. 0x0215 for forums) diff --git a/libretroshare/src/services/p3idservice.cc b/libretroshare/src/services/p3idservice.cc index 1c5204223..450e410f5 100644 --- a/libretroshare/src/services/p3idservice.cc +++ b/libretroshare/src/services/p3idservice.cc @@ -449,11 +449,11 @@ void p3IdService::notifyChanges(std::vector &changes) /* iterate through and grab any new messages */ std::list unprocessedGroups; - std::vector::iterator it; - for(it = changes.begin(); it != changes.end(); ++it) + for(uint32_t i = 0;i(*it); - RsGxsMsgChange *msgChange = dynamic_cast(*it); + RsGxsGroupChange *groupChange = dynamic_cast(changes[i]); + RsGxsMsgChange *msgChange = dynamic_cast(changes[i]); + if (msgChange && !msgChange->metaChange()) { #ifdef DEBUG_IDS @@ -479,10 +479,10 @@ void p3IdService::notifyChanges(std::vector &changes) std::cerr << "p3IdService::notifyChanges() Found Group Change Notification"; std::cerr << std::endl; #endif - std::list &groupList = groupChange->mGrpIdList; std::list::iterator git; - for(git = groupList.begin(); git != groupList.end(); ++git) + + for(git = groupList.begin(); git != groupList.end();) { #ifdef DEBUG_IDS std::cerr << "p3IdService::notifyChanges() Auto Subscribe to Incoming Groups: " << *git; @@ -496,15 +496,17 @@ void p3IdService::notifyChanges(std::vector &changes) // also time_stamp the key that this group represents timeStampKey(RsGxsId(*git)) ; + + ++git; } else - { - std::cerr << "(EE) Received banned identity " << *git << ": this should not happen. Deleting it!" << std::endl; - uint32_t token ; - RsGxsIdGroup group; - group.mMeta.mGroupId=RsGxsGroupId(*git); - deleteIdentity(token, group); - } + git = groupList.erase(git) ; + } + + if(groupList.empty()) + { + delete changes[i] ; + changes[i] = NULL ; } } } @@ -543,6 +545,12 @@ bool p3IdService::getIdDetails(const RsGxsId &id, RsIdentityDetails &details) if (mKeyCache.fetch(id, data)) { + // This step is needed, because p3GxsReputation does not know all identities, and might not have any data for + // the ones in the contact list. So we change them on demand. + + if((details.mFlags & RS_IDENTITY_FLAGS_IS_A_CONTACT) && rsReputations->nodeAutoPositiveOpinionForContacts()) + rsReputations->setOwnOpinion(id,RsReputations::OPINION_POSITIVE) ; + details = data.details; details.mLastUsageTS = locked_getLastUsageTS(id) ;