mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-28 18:42:20 -04:00
enabled bannign button in forums, and disable message passing for banned users
This commit is contained in:
parent
e309dd6fed
commit
1a76bea6ff
9 changed files with 45 additions and 25 deletions
|
@ -550,16 +550,16 @@ bool p3GxsReputation::getReputationInfo(const RsGxsId& gxsid, RsReputations::Rep
|
|||
return true ;
|
||||
}
|
||||
|
||||
bool p3GxsReputation::isIdentityOk(const RsGxsId &id)
|
||||
bool p3GxsReputation::isIdentityBanned(const RsGxsId &id)
|
||||
{
|
||||
RsReputations::ReputationInfo info ;
|
||||
|
||||
getReputationInfo(id,info) ;
|
||||
|
||||
#ifdef DEBUG_REPUTATION
|
||||
std::cerr << "isIdentityOk(): returning " << (info.mAssessment == RsReputations::ASSESSMENT_OK) << " for GXS id " << id << std::endl;
|
||||
std::cerr << "isIdentityBanned(): returning " << (info.mAssessment == RsReputations::ASSESSMENT_BAD) << " for GXS id " << id << std::endl;
|
||||
#endif
|
||||
return info.mAssessment == RsReputations::ASSESSMENT_OK ;
|
||||
return info.mAssessment == RsReputations::ASSESSMENT_BAD ;
|
||||
}
|
||||
|
||||
bool p3GxsReputation::setOwnOpinion(const RsGxsId& gxsid, const RsReputations::Opinion& opinion)
|
||||
|
|
|
@ -90,7 +90,7 @@ class p3GxsReputation: public p3Service, public p3Config, public RsReputations /
|
|||
/***** Interface for RsReputations *****/
|
||||
virtual bool setOwnOpinion(const RsGxsId& key_id, const Opinion& op) ;
|
||||
virtual bool getReputationInfo(const RsGxsId& id,ReputationInfo& info) ;
|
||||
virtual bool isIdentityOk(const RsGxsId& id) ;
|
||||
virtual bool isIdentityBanned(const RsGxsId& id) ;
|
||||
|
||||
/***** overloaded from p3Service *****/
|
||||
virtual int tick();
|
||||
|
|
|
@ -412,6 +412,8 @@ bool p3IdService:: getIdDetails(const RsGxsId &id, RsIdentityDetails &details)
|
|||
// one utf8 symbol can be at most 4 bytes long - would be better to measure real unicode length !!!
|
||||
if(details.mNickname.length() > RSID_MAXIMUM_NICKNAME_SIZE*4)
|
||||
details.mNickname = "[too long a name]" ;
|
||||
|
||||
rsReputations->getReputationInfo(id,details.mReputation) ;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -421,6 +423,9 @@ bool p3IdService:: getIdDetails(const RsGxsId &id, RsIdentityDetails &details)
|
|||
{
|
||||
details = data.details;
|
||||
details.mLastUsageTS = locked_getLastUsageTS(id) ;
|
||||
|
||||
rsReputations->getReputationInfo(id,details.mReputation) ;
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -831,7 +836,7 @@ bool p3IdService::getReputation(const RsGxsId &id, GixsReputation &rep)
|
|||
if (mPublicKeyCache.fetch(id, data))
|
||||
{
|
||||
rep.id = id;
|
||||
rep.score = data.details.mReputation.mOverallScore;
|
||||
rep.score = 0;//data.details.mReputation.mOverallScore;
|
||||
#ifdef DEBUG_IDS
|
||||
std::cerr << "p3IdService::getReputation() id: ";
|
||||
std::cerr << id.toStdString() << " score: " <<
|
||||
|
@ -1669,14 +1674,14 @@ void RsGxsIdCache::updateServiceString(std::string serviceString)
|
|||
}
|
||||
|
||||
// copy over Reputation scores.
|
||||
details.mReputation = ssdata.score.rep;
|
||||
//details.mReputation = ssdata.score.rep;
|
||||
}
|
||||
else
|
||||
{
|
||||
details.mPgpKnown = false;
|
||||
details.mPgpId.clear();
|
||||
details.mReputation.updateIdScore(false, false);
|
||||
details.mReputation.update();
|
||||
//details.mReputation.updateIdScore(false, false);
|
||||
//details.mReputation.update();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue