From 0ecbd0d22b26a8e05f107e945572e18bbedf43e5 Mon Sep 17 00:00:00 2001 From: chrisparker126 Date: Wed, 28 Aug 2013 19:27:04 +0000 Subject: [PATCH] fix for gxs channels not getting synchronised (reputation was getting requested for empty author ids) fix for external circle associated groups not synchronising message (circles being checked for peer who want to share out messages for circle associated group) git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@6635 b45a01b8-16f6-495d-af2f-9b41ad6348cc --- libretroshare/src/gxs/rsgxsnetservice.cc | 59 ++++++++++++++---------- 1 file changed, 34 insertions(+), 25 deletions(-) diff --git a/libretroshare/src/gxs/rsgxsnetservice.cc b/libretroshare/src/gxs/rsgxsnetservice.cc index 6465d4332..08e6739b4 100644 --- a/libretroshare/src/gxs/rsgxsnetservice.cc +++ b/libretroshare/src/gxs/rsgxsnetservice.cc @@ -414,6 +414,7 @@ bool RsGxsNetService::locked_canReceive(const RsGxsGrpMetaData * const grpMeta, return mCircles->canSend(grpMeta->mCircleId, pgpId); } + i++; } @@ -1208,27 +1209,28 @@ void RsGxsNetService::locked_genReqMsgTransaction(NxsTransaction* tr) RsNxsSyncMsgItem* item = msgItemL.front(); const std::string& grpId = item->grpId; - std::map grpMetaMap; - grpMetaMap[grpId] = NULL; - mDataStore->retrieveGxsGrpMetaData(grpMetaMap); - RsGxsGrpMetaData* grpMeta = grpMetaMap[grpId]; - - // you want to find out if you can receive it - // number polls essentially represent multiple - // of sleep interval - if(grpMeta) - { - bool can = locked_canReceive(grpMeta, tr->mTransaction->PeerId()); - - delete grpMeta; - - if(!can) - return; - - }else - { - return; - } +// std::map grpMetaMap; +// grpMetaMap[grpId] = NULL; +// mDataStore->retrieveGxsGrpMetaData(grpMetaMap); +// RsGxsGrpMetaData* grpMeta = grpMetaMap[grpId]; +// +// // you want to find out if you can receive it +// // number polls essentially represent multiple +// // of sleep interval +// if(grpMeta) +// { +// // always can receive, only provides weak guaranttee this peer is part of the group +// bool can = true;//locked_canReceive(grpMeta, tr->mTransaction->PeerId()); +// +// delete grpMeta; +// +// if(!can) +// return; +// +// }else +// { +// return; +// } GxsMsgReq reqIds; @@ -1266,12 +1268,19 @@ void RsGxsNetService::locked_genReqMsgTransaction(NxsTransaction* tr) if(msgIdSet.find(msgId) == msgIdSet.end()){ - if(mReputations->haveReputation(syncItem->authorId) || syncItem->authorId.empty()) + bool noAuthor = syncItem->authorId.empty(); + if(mReputations->haveReputation(syncItem->authorId) || noAuthor) { - GixsReputation rep; - mReputations->getReputation(syncItem->authorId, rep); - if(rep.score > GIXS_CUT_OFF) + + GixsReputation rep; + + if(!noAuthor) // has author + mReputations->getReputation(syncItem->authorId, rep); + + // if author is required for this message, it will simply get dropped + // at genexchange side of things + if(rep.score > GIXS_CUT_OFF || noAuthor) { RsNxsSyncMsgItem* msgItem = new RsNxsSyncMsgItem(mServType); msgItem->grpId = grpId;