diff --git a/libretroshare/src/chat/distributedchat.cc b/libretroshare/src/chat/distributedchat.cc index 88460f1f7..2ed75fd1b 100644 --- a/libretroshare/src/chat/distributedchat.cc +++ b/libretroshare/src/chat/distributedchat.cc @@ -34,7 +34,6 @@ #include "pqi/p3historymgr.h" #include "retroshare/rspeers.h" #include "retroshare/rsiface.h" -#include "retroshare/rsreputations.h" #include "retroshare/rsidentity.h" #include "rsserver/p3face.h" #include "gxs/rsgixs.h" @@ -139,7 +138,7 @@ bool DistributedChatService::handleRecvChatLobbyMsgItem(RsChatMsgItem *ci) return false ; } - if(rsReputations->isIdentityBanned(cli->signature.keyId)) + if(rsIdentity->isBanned(cli->signature.keyId)) { std::cerr << "(WW) Received lobby msg/item from banned identity " << cli->signature.keyId << ". Dropping it." << std::endl; return false ; @@ -648,7 +647,7 @@ void DistributedChatService::handleRecvChatLobbyEventItem(RsChatLobbyEventItem * #endif time_t now = time(NULL) ; - if(rsReputations->isIdentityBanned(item->signature.keyId)) + if(rsIdentity->isBanned(item->signature.keyId)) { std::cerr << "(WW) Received lobby msg/item from banned identity " << item->signature.keyId << ". Dropping it." << std::endl; return ; diff --git a/libretroshare/src/grouter/p3grouter.cc b/libretroshare/src/grouter/p3grouter.cc index 9b6f9a8de..1d698881c 100644 --- a/libretroshare/src/grouter/p3grouter.cc +++ b/libretroshare/src/grouter/p3grouter.cc @@ -191,7 +191,6 @@ #include "turtle/p3turtle.h" #include "gxs/rsgixs.h" #include "retroshare/rspeers.h" -#include "retroshare/rsreputations.h" #include "p3grouter.h" #include "grouteritems.h" @@ -1994,7 +1993,7 @@ bool p3GRouter::verifySignedDataItem(RsGRouterAbstractMsgItem *item,uint32_t& er { try { - if(rsReputations->isIdentityBanned(item->signature.keyId)) + if(rsIdentity->isBanned(item->signature.keyId)) { std::cerr << "(WW) received global router message from banned identity " << item->signature.keyId << ". Rejecting the message." << std::endl; return false ; diff --git a/libretroshare/src/gxs/rsgxsnetservice.cc b/libretroshare/src/gxs/rsgxsnetservice.cc index 8df2bea19..477e53613 100644 --- a/libretroshare/src/gxs/rsgxsnetservice.cc +++ b/libretroshare/src/gxs/rsgxsnetservice.cc @@ -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; diff --git a/libretroshare/src/gxs/rsgxsutil.cc b/libretroshare/src/gxs/rsgxsutil.cc index 0187e9cb4..22e2e8661 100644 --- a/libretroshare/src/gxs/rsgxsutil.cc +++ b/libretroshare/src/gxs/rsgxsutil.cc @@ -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) ; } diff --git a/libretroshare/src/retroshare/rsidentity.h b/libretroshare/src/retroshare/rsidentity.h index e57d43162..b36133d0b 100644 --- a/libretroshare/src/retroshare/rsidentity.h +++ b/libretroshare/src/retroshare/rsidentity.h @@ -253,6 +253,7 @@ virtual bool getRecognTagRequest(const RsGxsId &id, const std::string &comment, virtual bool setAsRegularContact(const RsGxsId& id,bool is_a_contact) = 0 ; virtual bool isARegularContact(const RsGxsId& id) = 0 ; + virtual bool isBanned(const RsGxsId& id) =0; // Specific RsIdentity Functions.... /* Specific Service Data */ diff --git a/libretroshare/src/retroshare/rsreputations.h b/libretroshare/src/retroshare/rsreputations.h index 6445efd09..f620f3d5e 100644 --- a/libretroshare/src/retroshare/rsreputations.h +++ b/libretroshare/src/retroshare/rsreputations.h @@ -50,14 +50,14 @@ public: }; virtual bool setOwnOpinion(const RsGxsId& key_id, const Opinion& op) =0; - virtual bool getReputationInfo(const RsGxsId& id,ReputationInfo& info) =0 ; + virtual bool getReputationInfo(const RsGxsId& id,const RsPgpId& owner_id,ReputationInfo& info) =0 ; virtual void setNodeAutoBanThreshold(uint32_t n) =0; virtual uint32_t nodeAutoBanThreshold() =0; // This one is a proxy designed to allow fast checking of a GXS id. // it basically returns true if assessment is not ASSESSMENT_OK - virtual bool isIdentityBanned(const RsGxsId& id) =0; + virtual bool isIdentityBanned(const RsGxsId& id,const RsPgpId& owner_node) =0; }; // To access reputations from anywhere diff --git a/libretroshare/src/services/p3gxsreputation.cc b/libretroshare/src/services/p3gxsreputation.cc index f806b4748..ce3b43ca5 100644 --- a/libretroshare/src/services/p3gxsreputation.cc +++ b/libretroshare/src/services/p3gxsreputation.cc @@ -39,6 +39,7 @@ /**** * #define DEBUG_REPUTATION 1 ****/ +#define DEBUG_REPUTATION 1 /************ IMPLEMENTATION NOTES ********************************* * @@ -333,11 +334,35 @@ void p3GxsReputation::updateIdentityFlags() void p3GxsReputation::cleanup() { // remove opinions from friends that havn't been seen online for more than the specified delay - + #ifdef DEBUG_REPUTATION - std::cerr << "p3GxsReputation::cleanup() " << std::endl; #endif - std::cerr << __PRETTY_FUNCTION__ << ": not implemented. TODO!" << std::endl; + std::cerr << "p3GxsReputation::cleanup() " << std::endl; + + // remove optionions about identities that do not exist anymore. That will in particular avoid asking p3idservice about deleted + // identities, which would cause an excess of hits to the database. + + bool updated = false ; + + RsStackMutex stack(mReputationMtx); /****** LOCKED MUTEX *******/ + + for(std::map::iterator it(mReputations.begin());it!=mReputations.end();) + if(it->second.mOpinions.empty() && it->second.mOwnOpinion == RsReputations::OPINION_NEUTRAL) + { + std::map::iterator tmp(it) ; + ++tmp ; + mReputations.erase(it) ; + it = tmp ; +#ifdef DEBUG_REPUTATION + std::cerr << " ID " << it->first << ": own is neutral and no opinions from friends => remove entry" << std::endl; +#endif + updated = true ; + } + else + ++it ; + + if(updated) + IndicateConfigChanged() ; } void p3GxsReputation::updateActiveFriends() @@ -668,7 +693,7 @@ bool p3GxsReputation::updateLatestUpdate(RsPeerId peerid,time_t latest_update) * Opinion ****/ -bool p3GxsReputation::getReputationInfo(const RsGxsId& gxsid, RsReputations::ReputationInfo& info) +bool p3GxsReputation::getReputationInfo(const RsGxsId& gxsid, const RsPgpId& owner_id, RsReputations::ReputationInfo& info) { if(gxsid.isNull()) return false ; @@ -678,25 +703,34 @@ bool p3GxsReputation::getReputationInfo(const RsGxsId& gxsid, RsReputations::Rep #ifdef DEBUG_REPUTATION std::cerr << "getReputationInfo() for " << gxsid << std::endl; #endif - Reputation& rep(mReputations[gxsid]) ; + std::map::const_iterator it = mReputations.find(gxsid) ; - info.mOwnOpinion = RsReputations::Opinion(rep.mOwnOpinion) ; - info.mOverallReputationScore = rep.mReputation ; - info.mFriendAverage = rep.mFriendAverage ; - - if( (rep.mIdentityFlags & REPUTATION_IDENTITY_FLAG_PGP_LINKED) && (mBannedPgpIds.find(rep.mOwnerNode) != mBannedPgpIds.end())) + if(it == mReputations.end()) { - info.mAssessment = RsReputations::ASSESSMENT_BAD ; -#ifdef DEBUG_REPUTATION - std::cerr << "p3GxsReputations: identity " << gxsid << " is banned because owner node ID " << rep.mOwnerNode << " is banned." << std::endl; -#endif - return true; + info.mOwnOpinion = RsReputations::OPINION_NEUTRAL ; + info.mOverallReputationScore = RsReputations::REPUTATION_THRESHOLD_DEFAULT ; + info.mFriendAverage = REPUTATION_THRESHOLD_DEFAULT ; } - - if(info.mOverallReputationScore > REPUTATION_ASSESSMENT_THRESHOLD_X1) - info.mAssessment = RsReputations::ASSESSMENT_OK ; else + { + const Reputation& rep(it->second) ; + + info.mOwnOpinion = RsReputations::Opinion(rep.mOwnOpinion) ; + info.mOverallReputationScore = rep.mReputation ; + info.mFriendAverage = rep.mFriendAverage ; + } + + if(!owner_id.isNull() && (mBannedPgpIds.find(owner_id) != mBannedPgpIds.end())) + { +#ifdef DEBUG_REPUTATION + std::cerr << "p3GxsReputations: identity " << gxsid << " is banned because owner node ID " << owner_id << " is banned." << std::endl; +#endif info.mAssessment = RsReputations::ASSESSMENT_BAD ; + } + else if(info.mOverallReputationScore <= REPUTATION_ASSESSMENT_THRESHOLD_X1) + info.mAssessment = RsReputations::ASSESSMENT_BAD ; + else + info.mAssessment = RsReputations::ASSESSMENT_OK ; #ifdef DEBUG_REPUTATION std::cerr << " information present. OwnOp = " << info.mOwnOpinion << ", overall score=" << info.mAssessment << std::endl; @@ -705,11 +739,12 @@ bool p3GxsReputation::getReputationInfo(const RsGxsId& gxsid, RsReputations::Rep return true ; } -bool p3GxsReputation::isIdentityBanned(const RsGxsId &id) +bool p3GxsReputation::isIdentityBanned(const RsGxsId &id,const RsPgpId& owner_node) { RsReputations::ReputationInfo info ; - getReputationInfo(id,info) ; + if(!getReputationInfo(id,owner_node,info)) + return false ; #ifdef DEBUG_REPUTATION std::cerr << "isIdentityBanned(): returning " << (info.mAssessment == RsReputations::ASSESSMENT_BAD) << " for GXS id " << id << std::endl; diff --git a/libretroshare/src/services/p3gxsreputation.h b/libretroshare/src/services/p3gxsreputation.h index ae49517e5..8dca8cd5a 100644 --- a/libretroshare/src/services/p3gxsreputation.h +++ b/libretroshare/src/services/p3gxsreputation.h @@ -97,8 +97,8 @@ 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 isIdentityBanned(const RsGxsId& id) ; + virtual bool getReputationInfo(const RsGxsId& id, const RsPgpId &owner_id, ReputationInfo& info) ; + virtual bool isIdentityBanned(const RsGxsId& id, const RsPgpId &owner_node) ; virtual void setNodeAutoBanThreshold(uint32_t n) ; virtual uint32_t nodeAutoBanThreshold() ; diff --git a/libretroshare/src/services/p3idservice.cc b/libretroshare/src/services/p3idservice.cc index 4d59be143..1abecd8f5 100644 --- a/libretroshare/src/services/p3idservice.cc +++ b/libretroshare/src/services/p3idservice.cc @@ -264,7 +264,7 @@ time_t p3IdService::locked_getLastUsageTS(const RsGxsId& gxs_id) } void p3IdService::timeStampKey(const RsGxsId& gxs_id) { - if(rsReputations->isIdentityBanned(gxs_id)) + if(isBanned(gxs_id)) { std::cerr << "(II) p3IdService:timeStampKey(): refusing to time stamp key " << gxs_id << " because it is banned." << std::endl; return; @@ -324,7 +324,7 @@ public: time_t now = time(NULL); const RsGxsId& gxs_id = entry.details.mId ; - bool is_id_banned = rsReputations->isIdentityBanned(gxs_id) ; + bool is_id_banned = rsReputations->isIdentityBanned(gxs_id,entry.details.mPgpId) ; bool is_own_id = (bool)(entry.details.mFlags & RS_IDENTITY_FLAGS_IS_OWN_ID) ; bool is_known_id = (bool)(entry.details.mFlags & RS_IDENTITY_FLAGS_PGP_KNOWN) ; bool is_signed_id = (bool)(entry.details.mFlags & RS_IDENTITY_FLAGS_PGP_LINKED) ; @@ -503,7 +503,7 @@ bool p3IdService:: getNickname(const RsGxsId &id, std::string &nickname) } #endif -bool p3IdService:: getIdDetails(const RsGxsId &id, RsIdentityDetails &details) +bool p3IdService::getIdDetails(const RsGxsId &id, RsIdentityDetails &details) { #ifdef DEBUG_IDS std::cerr << "p3IdService::getIdDetails(" << id << ")"; @@ -524,7 +524,7 @@ bool p3IdService:: getIdDetails(const RsGxsId &id, RsIdentityDetails &details) if(details.mNickname.length() > RSID_MAXIMUM_NICKNAME_SIZE*4) details.mNickname = "[too long a name]" ; - rsReputations->getReputationInfo(id,details.mReputation) ; + rsReputations->getReputationInfo(id,details.mPgpId,details.mReputation) ; return true; } @@ -536,6 +536,16 @@ bool p3IdService:: getIdDetails(const RsGxsId &id, RsIdentityDetails &details) return false; } +bool p3IdService::isBanned(const RsGxsId &id) +{ + RsIdentityDetails det ; + getIdDetails(id,det) ; + +#ifdef DEBUG_REPUTATION + std::cerr << "isIdentityBanned(): returning " << (det.mReputation.mAssessment == RsReputations::ASSESSMENT_BAD) << " for GXS id " << id << std::endl; +#endif + return det.mReputation.mAssessment == RsReputations::ASSESSMENT_BAD ; +} bool p3IdService::isOwnId(const RsGxsId& id) { diff --git a/libretroshare/src/services/p3idservice.h b/libretroshare/src/services/p3idservice.h index 316fad106..3c39e0a2d 100644 --- a/libretroshare/src/services/p3idservice.h +++ b/libretroshare/src/services/p3idservice.h @@ -274,6 +274,7 @@ virtual bool getRecognTagRequest(const RsGxsId &id, const std::string &comment, virtual bool setAsRegularContact(const RsGxsId& id,bool is_a_contact) ; virtual bool isARegularContact(const RsGxsId& id) ; + virtual bool isBanned(const RsGxsId& id) ; /**************** RsGixs Implementation ***************/ diff --git a/retroshare-gui/src/gui/Identity/IdDetailsDialog.cpp b/retroshare-gui/src/gui/Identity/IdDetailsDialog.cpp index 57e83c1b4..dcc3c78fb 100644 --- a/retroshare-gui/src/gui/Identity/IdDetailsDialog.cpp +++ b/retroshare-gui/src/gui/Identity/IdDetailsDialog.cpp @@ -26,7 +26,6 @@ #include "gui/common/UIStateHelper.h" #include -#include // Data Requests. #define IDDETAILSDIALOG_IDDETAILS 1 @@ -261,7 +260,7 @@ void IdDetailsDialog::insertIdDetails(uint32_t token) #endif RsReputations::ReputationInfo info ; - rsReputations->getReputationInfo(RsGxsId(data.mMeta.mGroupId),info) ; + rsReputations->getReputationInfo(RsGxsId(data.mMeta.mGroupId),data.mPgpId,info) ; ui->neighborNodesOpinion_TF->setText(QString::number(info.mOverallReputationScore-1.0f)); diff --git a/retroshare-gui/src/gui/Identity/IdDialog.cpp b/retroshare-gui/src/gui/Identity/IdDialog.cpp index 583c83375..137f9d23a 100644 --- a/retroshare-gui/src/gui/Identity/IdDialog.cpp +++ b/retroshare-gui/src/gui/Identity/IdDialog.cpp @@ -41,7 +41,6 @@ #include "util/QtVersion.h" #include -#include #include "retroshare/rsgxsflags.h" #include "retroshare/rsmsgs.h" #include @@ -1360,8 +1359,8 @@ bool IdDialog::fillIdListItem(const RsGxsIdGroup& data, QTreeWidgetItem *&item, if (!item) item = new TreeWidgetItem(); - RsReputations::ReputationInfo info ; - rsReputations->getReputationInfo(RsGxsId(data.mMeta.mGroupId),info) ; + RsIdentityDetails idd ; + rsIdentity->getIdDetails(RsGxsId(data.mMeta.mGroupId),idd) ; item->setText(RSID_COL_NICKNAME, QString::fromUtf8(data.mMeta.mGroupName.c_str()).left(RSID_MAXIMUM_NICKNAME_SIZE)); item->setText(RSID_COL_KEYID, QString::fromStdString(data.mMeta.mGroupId.toStdString())); @@ -1372,13 +1371,10 @@ bool IdDialog::fillIdListItem(const RsGxsIdGroup& data, QTreeWidgetItem *&item, item->setData(RSID_COL_KEYID, Qt::UserRole,QVariant(item_flags)) ; item->setTextAlignment(RSID_COL_VOTES, Qt::AlignRight); - item->setData(RSID_COL_VOTES,Qt::DisplayRole, QString::number(info.mOverallReputationScore - 1.0f,'f',3)); + item->setData(RSID_COL_VOTES,Qt::DisplayRole, QString::number(idd.mReputation.mOverallReputationScore - 1.0f,'f',3)); if(isOwnId) { - RsIdentityDetails idd ; - rsIdentity->getIdDetails(RsGxsId(data.mMeta.mGroupId),idd) ; - QFont font = item->font(RSID_COL_NICKNAME) ; font.setBold(true) ; @@ -1740,7 +1736,7 @@ void IdDialog::insertIdDetails(uint32_t token) #endif RsReputations::ReputationInfo info ; - rsReputations->getReputationInfo(RsGxsId(data.mMeta.mGroupId),info) ; + rsReputations->getReputationInfo(RsGxsId(data.mMeta.mGroupId),data.mPgpId,info) ; ui->neighborNodesOpinion_TF->setText(QString::number(info.mFriendAverage - 1.0f)); @@ -2021,10 +2017,10 @@ void IdDialog::IdListCustomPopupMenu( QPoint ) #endif RsGxsId keyId((*it)->text(RSID_COL_KEYID).toStdString()); - RsReputations::ReputationInfo info ; - rsReputations->getReputationInfo(keyId,info) ; + RsIdentityDetails det ; + rsIdentity->getIdDetails(keyId,det) ; - switch(info.mOwnOpinion) + switch(det.mReputation.mOwnOpinion) { case RsReputations::OPINION_NEGATIVE: ++n_negative_reputations ; break ; diff --git a/retroshare-gui/src/gui/gxs/GxsIdDetails.cpp b/retroshare-gui/src/gui/gxs/GxsIdDetails.cpp index 7458e0406..c1205e6b3 100644 --- a/retroshare-gui/src/gui/gxs/GxsIdDetails.cpp +++ b/retroshare-gui/src/gui/gxs/GxsIdDetails.cpp @@ -905,7 +905,7 @@ bool GxsIdDetails::MakeIdDesc(const RsGxsId &id, bool doIcons, QString &str, QLi QString GxsIdDetails::getName(const RsIdentityDetails &details) { - if(rsReputations->isIdentityBanned(details.mId)) + if(rsIdentity->isBanned(details.mId)) return tr("[Banned]") ; QString name = QString::fromUtf8(details.mNickname.c_str()).left(RSID_MAXIMUM_NICKNAME_SIZE); @@ -924,7 +924,7 @@ QString GxsIdDetails::getComment(const RsIdentityDetails &details) QString comment; QString nickname ; - bool banned = rsReputations->isIdentityBanned(details.mId) ; + bool banned = rsIdentity->isBanned(details.mId) ; if(details.mNickname.empty()) nickname = tr("[Unknown]") ; @@ -963,7 +963,7 @@ void GxsIdDetails::getIcons(const RsIdentityDetails &details, QList &icon { QPixmap pix ; - if(rsReputations->isIdentityBanned(details.mId)) + if(rsIdentity->isBanned(details.mId)) { icons.clear() ; icons.push_back(QIcon(IMAGE_BANNED)) ; diff --git a/retroshare-gui/src/gui/gxs/GxsIdTreeWidgetItem.cpp b/retroshare-gui/src/gui/gxs/GxsIdTreeWidgetItem.cpp index d002e9541..998a98a5e 100644 --- a/retroshare-gui/src/gui/gxs/GxsIdTreeWidgetItem.cpp +++ b/retroshare-gui/src/gui/gxs/GxsIdTreeWidgetItem.cpp @@ -117,14 +117,14 @@ void GxsIdRSTreeWidgetItem::setId(const RsGxsId &id, int column, bool retryWhenF void GxsIdRSTreeWidgetItem::updateBannedState() { - if(mBannedState != rsReputations->isIdentityBanned(mId)) + if(mBannedState != rsIdentity->isBanned(mId)) forceUpdate() ; } void GxsIdRSTreeWidgetItem::forceUpdate() { mIdFound = false; - mBannedState = rsReputations->isIdentityBanned(mId) ; + mBannedState = rsIdentity->isBanned(mId) ; startProcess(); } @@ -170,7 +170,7 @@ QVariant GxsIdRSTreeWidgetItem::data(int column, int role) const if(mId.isNull()) return RSTreeWidgetItem::data(column, role); - else if(rsReputations->isIdentityBanned(mId)) + else if(rsIdentity->isBanned(mId)) pix = QImage(BANNED_IMAGE) ; else if (mAvatar.mSize == 0 || !pix.loadFromData(mAvatar.mData, mAvatar.mSize, "PNG")) pix = GxsIdDetails::makeDefaultIcon(mId); diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp index 82ed1e6dd..19ef8c89a 100644 --- a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp +++ b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.cpp @@ -985,7 +985,7 @@ QTreeWidgetItem *GxsForumThreadWidget::convertMsgToThreadWidget(const RsGxsForum // is flagged with a bad reputation - bool redacted = rsReputations->isIdentityBanned(msg.mMeta.mAuthorId) ; + bool redacted = rsIdentity->isBanned(msg.mMeta.mAuthorId) ; GxsIdRSTreeWidgetItem *item = new GxsIdRSTreeWidgetItem(mThreadCompareRole,GxsIdDetails::ICON_TYPE_ALL || (redacted?(GxsIdDetails::ICON_TYPE_REDACTED):0)); item->moveToThread(ui->threadTreeWidget->thread()); @@ -1408,7 +1408,7 @@ void GxsForumThreadWidget::insertMessageData(const RsGxsForumMsg &msg) return; } - bool redacted = rsReputations->isIdentityBanned(msg.mMeta.mAuthorId) ; + bool redacted = rsIdentity->isBanned(msg.mMeta.mAuthorId) ; mStateHelper->setActive(mTokenTypeMessageData, true);