added removal of messages frm banned users

This commit is contained in:
csoler 2015-10-10 18:27:15 -04:00
parent 59d2ca9c3d
commit 68ca57ce75
5 changed files with 55 additions and 20 deletions

View file

@ -30,6 +30,7 @@
#include "rsgxsnetservice.h"
#include "retroshare/rsconfig.h"
#include "retroshare/rsreputations.h"
#include "retroshare/rsgxsflags.h"
#include "retroshare/rsgxscircles.h"
#include "pgp/pgpauxutils.h"
@ -2009,7 +2010,7 @@ void RsGxsNetService::locked_genReqMsgTransaction(NxsTransaction* tr)
// if author is required for this message, it will simply get dropped
// at genexchange side of things
if(rep.score > (int)grpMeta->mReputationCutOff || noAuthor)
if(rsReputations->isIdentityOk(syncItem->authorId) && rep.score > (int)grpMeta->mReputationCutOff || noAuthor)
{
#ifdef NXS_NET_DEBUG
std::cerr << ", passed! Adding message to req list." << std::endl;
@ -2225,7 +2226,7 @@ void RsGxsNetService::locked_genReqGrpTransaction(NxsTransaction* tr)
GixsReputation rep;
mReputations->getReputation(grpSyncItem->authorId, rep);
if(rep.score >= GIXS_CUT_OFF)
if(rep.score >= GIXS_CUT_OFF && rsReputations->isIdentityOk(grpSyncItem->authorId))
{
addGroupItemToList(tr, grpId, transN, reqList);
std::cerr << " reputation cut off: limit=" << GIXS_CUT_OFF << " value=" << rep.score << ": allowed." << std::endl;

View file

@ -567,6 +567,12 @@ bool p3GxsReputation::setOwnOpinion(const RsGxsId& gxsid, const RsReputations::O
#ifdef DEBUG_REPUTATION
std::cerr << "setOwnOpinion(): for GXS id " << gxsid << " to " << opinion << std::endl;
#endif
if(gxsid.isNull())
{
std::cerr << " ID " << gxsid << " is rejected. Look for a bug in calling method." << std::endl;
return false ;
}
RsStackMutex stack(mReputationMtx); /****** LOCKED MUTEX *******/
std::map<RsGxsId, Reputation>::iterator rit;