diff --git a/libretroshare/src/gxs/rsgenexchange.cc b/libretroshare/src/gxs/rsgenexchange.cc index aa098a1dc..742bec46d 100644 --- a/libretroshare/src/gxs/rsgenexchange.cc +++ b/libretroshare/src/gxs/rsgenexchange.cc @@ -1668,14 +1668,14 @@ void RsGenExchange::updateGroup(uint32_t& token, RsGxsGrpItem* grpItem) #endif } -void RsGenExchange::deleteGroup(uint32_t& token, RsGxsGrpItem* grpItem) +void RsGenExchange::deleteGroup(uint32_t& token, const RsGxsGroupId& grpId) { - RS_STACK_MUTEX(mGenMtx) ; + RS_STACK_MUTEX(mGenMtx) ; token = mDataAccess->generatePublicToken(); - mGroupDeletePublish.push_back(GroupDeletePublish(grpItem, token)); + mGroupDeletePublish.push_back(GroupDeletePublish(grpId, token)); #ifdef GEN_EXCH_DEBUG - std::cerr << "RsGenExchange::deleteGroup() token: " << token; + std::cerr << "RsGenExchange::deleteGroup() token: " << token; std::cerr << std::endl; #endif } @@ -2319,14 +2319,10 @@ void RsGenExchange::processGroupDelete() std::vector::iterator vit = mGroupDeletePublish.begin(); for(; vit != mGroupDeletePublish.end(); ++vit) { - GroupDeletePublish& gdp = *vit; - uint32_t token = gdp.mToken; - const RsGxsGroupId& groupId = gdp.grpItem->meta.mGroupId; std::vector gprIds; - gprIds.push_back(groupId); + gprIds.push_back(vit->mGroupId); mDataStore->removeGroups(gprIds); - toNotify.insert(std::make_pair( - token, GrpNote(true, groupId))); + toNotify.insert(std::make_pair( vit->mToken, GrpNote(true, vit->mGroupId))); } diff --git a/libretroshare/src/gxs/rsgenexchange.h b/libretroshare/src/gxs/rsgenexchange.h index 87b2344e8..21ea4365c 100644 --- a/libretroshare/src/gxs/rsgenexchange.h +++ b/libretroshare/src/gxs/rsgenexchange.h @@ -519,7 +519,7 @@ protected: * @param token * @param grpItem */ - void deleteGroup(uint32_t& token, RsGxsGrpItem* grpItem); + void deleteGroup(uint32_t& token, const RsGxsGroupId &grpId); public: /*! diff --git a/libretroshare/src/gxs/rsgxsutil.h b/libretroshare/src/gxs/rsgxsutil.h index fdcc96246..a47b981d3 100644 --- a/libretroshare/src/gxs/rsgxsutil.h +++ b/libretroshare/src/gxs/rsgxsutil.h @@ -222,9 +222,9 @@ public: class GroupDeletePublish { public: - GroupDeletePublish(RsGxsGrpItem* item, uint32_t token) - : grpItem(item), mToken(token) {} - RsGxsGrpItem* grpItem; + GroupDeletePublish(const RsGxsGroupId& grpId, uint32_t token) + : mGroupId(grpId), mToken(token) {} + RsGxsGroupId mGroupId; uint32_t mToken; }; diff --git a/libretroshare/src/services/p3idservice.cc b/libretroshare/src/services/p3idservice.cc index a81d9ccf9..db803abdc 100644 --- a/libretroshare/src/services/p3idservice.cc +++ b/libretroshare/src/services/p3idservice.cc @@ -1433,17 +1433,14 @@ bool p3IdService::updateGroup(uint32_t& token, RsGxsIdGroup &group) bool p3IdService::deleteGroup(uint32_t& token, RsGxsIdGroup &group) { - RsGxsId id = RsGxsId(group.mMeta.mGroupId.toStdString()); - RsGxsIdGroupItem* item = new RsGxsIdGroupItem(); - - item->fromGxsIdGroup(group,false) ; + RsGxsId id(group.mMeta.mGroupId); #ifdef DEBUG_IDS std::cerr << "p3IdService::deleteGroup() Deleting RsGxsId: " << id; std::cerr << std::endl; #endif - RsGenExchange::deleteGroup(token, item); + RsGenExchange::deleteGroup(token,group.mMeta.mGroupId); // if its in the cache - clear it. {