removed the reputation calls through rsIdentity. Improved the logic of updating static identity flags in p3gxsreputations

This commit is contained in:
csoler 2017-01-09 23:47:51 +01:00
parent 2fc8d22cf9
commit 8d8453f9c0
10 changed files with 78 additions and 48 deletions

View file

@ -179,6 +179,7 @@ public:
virtual bool haveReputation(const RsGxsId &id) = 0;
virtual bool loadReputation(const RsGxsId &id, const std::list<RsPeerId>& peers) = 0;
virtual bool getReputation(const RsGxsId &id, GixsReputation &rep) = 0;
virtual RsReputations::ReputationLevel overallReputationLevel(const RsGxsId& id) = 0;
};
/*** This Class pulls all the GXS Interfaces together ****/

View file

@ -2738,9 +2738,11 @@ void RsGxsNetService::locked_genReqMsgTransaction(NxsTransaction* tr)
return ;
}
#ifdef TO_REMOVE
int cutoff = 0;
if(grpMeta != NULL)
cutoff = grpMeta->mReputationCutOff;
#endif
GxsMsgReq reqIds;
reqIds[grpId] = std::vector<RsGxsMessageId>();
@ -2827,7 +2829,7 @@ void RsGxsNetService::locked_genReqMsgTransaction(NxsTransaction* tr)
// - if author is locally banned, do not download.
// - if author is not locally banned, download, whatever friends' opinion might be.
if(rsIdentity && rsIdentity->overallReputationLevel(syncItem->authorId) == RsReputations::REPUTATION_LOCALLY_NEGATIVE)
if(mReputations->overallReputationLevel(syncItem->authorId) == RsReputations::REPUTATION_LOCALLY_NEGATIVE)
{
#ifdef NXS_NET_DEBUG_1
GXSNETDEBUG_PG(item->PeerId(),grpId) << ", Identity " << syncItem->authorId << " is banned. Not requesting message!" << std::endl;
@ -3017,7 +3019,7 @@ void RsGxsNetService::locked_genReqGrpTransaction(NxsTransaction* tr)
// FIXTESTS global variable rsReputations not available in unittests!
#warning Update the code below to correctly send/recv dependign on reputation
if(!grpSyncItem->authorId.isNull() && rsIdentity && rsIdentity->overallReputationLevel(grpSyncItem->authorId) == RsReputations::REPUTATION_LOCALLY_NEGATIVE)
if(!grpSyncItem->authorId.isNull() && mReputations->overallReputationLevel(grpSyncItem->authorId) == RsReputations::REPUTATION_LOCALLY_NEGATIVE)
{
#ifdef NXS_NET_DEBUG_0
GXSNETDEBUG_PG(tr->mTransaction->PeerId(),grpId) << " Identity " << grpSyncItem->authorId << " is banned. Not syncing group." << std::endl;