moved isIdentitybanned from p3GxsReputations to p3IdService, so as to avoid calling back p3IdService from p3GxsReputations, which simplifies the code

This commit is contained in:
csoler 2016-07-03 18:06:01 -04:00
parent 720c6fd915
commit e611b2bb05
15 changed files with 100 additions and 63 deletions

View file

@ -204,7 +204,6 @@
#include "rsgxsnetservice.h"
#include "gxssecurity.h"
#include "retroshare/rsconfig.h"
#include "retroshare/rsreputations.h"
#include "retroshare/rsgxsflags.h"
#include "retroshare/rsgxscircles.h"
#include "pgp/pgpauxutils.h"
@ -2928,9 +2927,8 @@ void RsGxsNetService::locked_genReqMsgTransaction(NxsTransaction* tr)
#endif
continue;
}
// FIXTESTS global variable rsReputations not available in unittests!
if(rsReputations == 0){ std::cerr << "rsReputations==0, accepting all messages!" << std::endl; }
if(rsReputations && rsReputations->isIdentityBanned(syncItem->authorId))
if(rsIdentity && rsIdentity->isBanned(syncItem->authorId))
{
#ifdef NXS_NET_DEBUG_1
GXSNETDEBUG_PG(item->PeerId(),grpId) << ", Identity " << syncItem->authorId << " is banned. Not requesting message!" << std::endl;
@ -3174,8 +3172,8 @@ void RsGxsNetService::locked_genReqGrpTransaction(NxsTransaction* tr)
latestVersion = grpSyncItem->publishTs > metaIter->second->mPublishTs;
}
// FIXTESTS global variable rsReputations not available in unittests!
if(rsReputations == 0){ std::cerr << "rsReputations==0, accepting all groups!" << std::endl; }
if(!grpSyncItem->authorId.isNull() && rsReputations && rsReputations->isIdentityBanned(grpSyncItem->authorId))
if(!grpSyncItem->authorId.isNull() && rsIdentity && rsIdentity->isBanned(grpSyncItem->authorId))
{
#ifdef NXS_NET_DEBUG_0
GXSNETDEBUG_PG(tr->mTransaction->PeerId(),grpId) << " Identity " << grpSyncItem->authorId << " is banned. Not syncing group." << std::endl;

View file

@ -28,7 +28,6 @@
#include "rsgxsutil.h"
#include "retroshare/rsgxsflags.h"
#include "retroshare/rspeers.h"
#include "retroshare/rsreputations.h"
#include "pqi/pqihash.h"
#include "gxs/rsgixs.h"
@ -165,7 +164,7 @@ bool RsGxsIntegrityCheck::check()
std::cerr << "TimeStamping group authors' key ID " << grp->metaData->mAuthorId << " in group ID " << grp->grpId << std::endl;
#endif
if(rsReputations!=NULL && !rsReputations->isIdentityBanned(grp->metaData->mAuthorId))
if(rsIdentity!=NULL && !rsIdentity->isBanned(grp->metaData->mAuthorId))
used_gxs_ids.insert(grp->metaData->mAuthorId) ;
}
}
@ -247,7 +246,7 @@ bool RsGxsIntegrityCheck::check()
#ifdef GXSUTIL_DEBUG
std::cerr << "TimeStamping message authors' key ID " << msg->metaData->mAuthorId << " in message " << msg->msgId << ", group ID " << msg->grpId<< std::endl;
#endif
if(rsReputations!=NULL && !rsReputations->isIdentityBanned(msg->metaData->mAuthorId))
if(rsIdentity!=NULL && !rsIdentity->isBanned(msg->metaData->mAuthorId))
used_gxs_ids.insert(msg->metaData->mAuthorId) ;
}