diff --git a/libretroshare/src/chat/distributedchat.cc b/libretroshare/src/chat/distributedchat.cc
index 9f4a4274e..8fbc8f624 100644
--- a/libretroshare/src/chat/distributedchat.cc
+++ b/libretroshare/src/chat/distributedchat.cc
@@ -138,7 +138,7 @@ bool DistributedChatService::handleRecvChatLobbyMsgItem(RsChatMsgItem *ci)
return false ;
}
- if(rsIdentity->isBanned(cli->signature.keyId))
+ if(rsIdentity->overallReputationLevel(cli->signature.keyId) == RsReputations::REPUTATION_LOCALLY_NEGATIVE)
{
std::cerr << "(WW) Received lobby msg/item from banned identity " << cli->signature.keyId << ". Dropping it." << std::endl;
return false ;
@@ -220,7 +220,7 @@ bool DistributedChatService::checkSignature(RsChatLobbyBouncingObject *obj,const
// network pre-request key to allow message authentication.
- mGixs->requestKey(obj->signature.keyId,peer_list);
+ mGixs->requestKey(obj->signature.keyId,peer_list,"Needed for chat lobby "+RsUtil::NumberToString(obj->lobby_id,true));
uint32_t size = obj->signed_serial_size() ;
RsTemporaryMemory memory(size) ;
@@ -238,7 +238,7 @@ bool DistributedChatService::checkSignature(RsChatLobbyBouncingObject *obj,const
uint32_t error_status ;
- if(!mGixs->validateData(memory,obj->signed_serial_size(),obj->signature,false,error_status))
+ if(!mGixs->validateData(memory,obj->signed_serial_size(),obj->signature,false,"Chat lobby "+RsUtil::NumberToString(obj->lobby_id,true),error_status))
{
bool res = false ;
@@ -647,7 +647,7 @@ void DistributedChatService::handleRecvChatLobbyEventItem(RsChatLobbyEventItem *
#endif
time_t now = time(NULL) ;
- if(rsIdentity->isBanned(item->signature.keyId))
+ if(rsIdentity->overallReputationLevel(item->signature.keyId) == RsReputations::REPUTATION_LOCALLY_NEGATIVE)
{
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 5c51a196d..1cb8cb360 100644
--- a/libretroshare/src/grouter/p3grouter.cc
+++ b/libretroshare/src/grouter/p3grouter.cc
@@ -1555,7 +1555,7 @@ void p3GRouter::handleIncomingReceiptItem(RsGRouterSignedReceiptItem *receipt_it
uint32_t error_status ;
- if(! verifySignedDataItem(receipt_item,error_status))
+ if(! verifySignedDataItem(receipt_item,"GRouter incoming receipt item",error_status))
if( (it->second.routing_flags & GRouterRoutingInfo::ROUTING_FLAGS_IS_ORIGIN) || (error_status != RsGixs::RS_GIXS_ERROR_KEY_NOT_AVAILABLE))
{
std::cerr << " checking receipt signature : FAILED. Receipt is dropped. Error status=" << error_status << std::endl;
@@ -1711,7 +1711,7 @@ void p3GRouter::handleIncomingDataItem(RsGRouterGenericDataItem *data_item)
#endif
uint32_t error_status ;
- if(!verifySignedDataItem(data_item,error_status)) // we should get proper flags out of this
+ if(!verifySignedDataItem(data_item,"Incoming distant message",error_status)) // we should get proper flags out of this
{
std::cerr << " verifying item signature: FAILED! Droping that item" ;
std::cerr << " You probably received a message from a person you don't have key." << std::endl;
@@ -1980,11 +1980,11 @@ bool p3GRouter::signDataItem(RsGRouterAbstractMsgItem *item,const RsGxsId& signi
return false ;
}
}
-bool p3GRouter::verifySignedDataItem(RsGRouterAbstractMsgItem *item,uint32_t& error_status)
+bool p3GRouter::verifySignedDataItem(RsGRouterAbstractMsgItem *item,const std::string& info,uint32_t& error_status)
{
try
{
- if(rsIdentity->isBanned(item->signature.keyId))
+ if(rsIdentity->overallReputationLevel(item->signature.keyId) == RsReputations::REPUTATION_LOCALLY_NEGATIVE)
{
std::cerr << "(WW) received global router message from banned identity " << item->signature.keyId << ". Rejecting the message." << std::endl;
return false ;
@@ -1999,7 +1999,7 @@ bool p3GRouter::verifySignedDataItem(RsGRouterAbstractMsgItem *item,uint32_t& er
if(!item->serialise_signed_data(data,data_size))
throw std::runtime_error("Cannot serialise signed data.") ;
- if(!mGixs->validateData(data,data_size,item->signature,true,error_status))
+ if(!mGixs->validateData(data,data_size,item->signature,true,info, error_status))
{
switch(error_status)
{
@@ -2010,7 +2010,7 @@ bool p3GRouter::verifySignedDataItem(RsGRouterAbstractMsgItem *item,uint32_t& er
std::cerr << "(EE) Key for GXS Id " << item->signature.keyId << " is not available. Cannot verify. Asking key to peer " << item->PeerId() << std::endl;
- mGixs->requestKey(item->signature.keyId,peer_ids) ; // request the key around
+ mGixs->requestKey(item->signature.keyId,peer_ids,info) ; // request the key around
}
break ;
case RsGixs::RS_GIXS_ERROR_SIGNATURE_MISMATCH: std::cerr << "(EE) Signature mismatch. Spoofing/Corrupted/MITM?." << std::endl;
@@ -2116,7 +2116,7 @@ bool p3GRouter::sendData(const RsGxsId& destination,const GRouterServiceId& clie
// Verify the signature. If that fails, there's a bug somewhere!!
uint32_t error_status;
- if(!verifySignedDataItem(data_item,error_status))
+ if(!verifySignedDataItem(data_item,"GRouter own signature check for outgoing msg",error_status))
{
std::cerr << "Cannot verify data item that was just signed. Some error occured!" << std::endl;
delete data_item;
diff --git a/libretroshare/src/grouter/p3grouter.h b/libretroshare/src/grouter/p3grouter.h
index 9ddf50149..19d704add 100644
--- a/libretroshare/src/grouter/p3grouter.h
+++ b/libretroshare/src/grouter/p3grouter.h
@@ -254,7 +254,7 @@ private:
// signs an item with the given key.
bool signDataItem(RsGRouterAbstractMsgItem *item,const RsGxsId& id) ;
- bool verifySignedDataItem(RsGRouterAbstractMsgItem *item, uint32_t &error_status) ;
+ bool verifySignedDataItem(RsGRouterAbstractMsgItem *item, const std::string &info, uint32_t &error_status) ;
bool encryptDataItem(RsGRouterGenericDataItem *item,const RsGxsId& destination_key) ;
bool decryptDataItem(RsGRouterGenericDataItem *item) ;
diff --git a/libretroshare/src/gxs/rsgenexchange.cc b/libretroshare/src/gxs/rsgenexchange.cc
index c9d49fef0..7e1331396 100644
--- a/libretroshare/src/gxs/rsgenexchange.cc
+++ b/libretroshare/src/gxs/rsgenexchange.cc
@@ -86,14 +86,14 @@ RsGenExchange::RsGenExchange(RsGeneralDataService *gds, RsNetworkExchangeService
CREATE_FAIL(0),
CREATE_SUCCESS(1),
CREATE_FAIL_TRY_LATER(2),
- SIGN_MAX_ATTEMPTS(5),
+ SIGN_MAX_WAITING_TIME(60),
SIGN_FAIL(0),
SIGN_SUCCESS(1),
SIGN_FAIL_TRY_LATER(2),
VALIDATE_FAIL(0),
VALIDATE_SUCCESS(1),
VALIDATE_FAIL_TRY_LATER(2),
- VALIDATE_MAX_ATTEMPTS(5)
+ VALIDATE_MAX_WAITING_TIME(60)
{
mDataAccess = new RsGxsDataAccess(gds);
@@ -472,8 +472,8 @@ int RsGenExchange::createGroupSignatures(RsTlvKeySignatureSet& signSet, RsTlvBin
if(GxsSecurity::getSignature((char*)grpData.bin_data, grpData.bin_len, authorKey, sign))
{
id_ret = SIGN_SUCCESS;
- mGixs->timeStampKey(grpMeta.mAuthorId) ;
- signSet.keySignSet[INDEX_AUTHEN_IDENTITY] = sign;
+ mGixs->timeStampKey(grpMeta.mAuthorId,"Creation of group author signature for GrpId" + grpMeta.mGroupId.toStdString()) ;
+ signSet.keySignSet[INDEX_AUTHEN_IDENTITY] = sign;
}
else
id_ret = SIGN_FAIL;
@@ -640,7 +640,7 @@ int RsGenExchange::createMsgSignatures(RsTlvKeySignatureSet& signSet, RsTlvBinar
if(GxsSecurity::getSignature((char*)msgData.bin_data, msgData.bin_len, authorKey, sign))
{
id_ret = SIGN_SUCCESS;
- mGixs->timeStampKey(msgMeta.mAuthorId) ;
+ mGixs->timeStampKey(msgMeta.mAuthorId,"Creating author signature in group " + msgMeta.mGroupId.toStdString() + ", msg " + msgMeta.mMsgId.toStdString()) ;
signSet.keySignSet[INDEX_AUTHEN_IDENTITY] = sign;
}
else
@@ -857,7 +857,7 @@ int RsGenExchange::validateMsg(RsNxsMsg *msg, const uint32_t& grpFlag, const uin
{
RsTlvKeySignature sign = metaData.signSet.keySignSet[INDEX_AUTHEN_IDENTITY];
idValidate &= GxsSecurity::validateNxsMsg(*msg, sign, authorKey);
- mGixs->timeStampKey(metaData.mAuthorId) ;
+ mGixs->timeStampKey(metaData.mAuthorId,"Validation of author signature, service: " + rsServiceControl->getServiceName(serviceFullType()) + ". Grp="+metaData.mGroupId.toStdString()+", msg="+metaData.mMsgId.toStdString()) ;
}
else
{
@@ -882,20 +882,13 @@ int RsGenExchange::validateMsg(RsNxsMsg *msg, const uint32_t& grpFlag, const uin
else
{
- // now check reputation of the message author
- float reputation_threshold = RsReputations::REPUTATION_THRESHOLD_DEFAULT;
-
- if( (signFlag & GXS_SERV::FLAG_AUTHOR_AUTHENTICATION_GPG_KNOWN) && !(details.mFlags & RS_IDENTITY_FLAGS_PGP_KNOWN))
- reputation_threshold = RsReputations::REPUTATION_THRESHOLD_ANTI_SPAM;
- else if( (signFlag & GXS_SERV::FLAG_AUTHOR_AUTHENTICATION_GPG) && !(details.mFlags & RS_IDENTITY_FLAGS_PGP_LINKED))
- reputation_threshold = RsReputations::REPUTATION_THRESHOLD_ANTI_SPAM;
- else
- reputation_threshold = RsReputations::REPUTATION_THRESHOLD_DEFAULT;
-
- if(details.mReputation.mOverallReputationScore < reputation_threshold)
+ // now check reputation of the message author. The reputation will need to be at least as high as this value for the msg to validate.
+ // At validation step, we accept all messages, except the ones signed by locally rejected identities.
+
+ if(details.mReputation.mOverallReputationLevel == RsReputations::REPUTATION_LOCALLY_NEGATIVE)
{
#ifdef GEN_EXCH_DEBUG
- std::cerr << "RsGenExchange::validateMsg(): message from " << metaData.mAuthorId << ", rejected because reputation score (" << details.mReputation.mOverallReputationScore <<") is below the accepted threshold (" << reputation_threshold << ")" << std::endl;
+ std::cerr << "RsGenExchange::validateMsg(): message from " << metaData.mAuthorId << ", rejected because reputation score (" << details.mReputation.mOverallReputationLevel <<") is below the accepted threshold (" << reputation_threshold << ")" << std::endl;
#endif
idValidate = false ;
}
@@ -905,13 +898,13 @@ int RsGenExchange::validateMsg(RsNxsMsg *msg, const uint32_t& grpFlag, const uin
#endif
}
- }
+ }
}
else
{
std::list peers;
peers.push_back(msg->PeerId());
- mGixs->requestKey(metaData.mAuthorId, peers);
+ mGixs->requestKey(metaData.mAuthorId, peers,"Validation of author signature, service: " + rsServiceControl->getServiceName(serviceFullType()) + ". Grp="+metaData.mGroupId.toStdString()+", msg="+metaData.mMsgId.toStdString());
#ifdef GEN_EXCH_DEBUG
std::cerr << ", Key missing. Retry later." << std::endl;
@@ -988,7 +981,7 @@ int RsGenExchange::validateGrp(RsNxsGrp* grp)
#ifdef GEN_EXCH_DEBUG
std::cerr << " key ID validation result: " << idValidate << std::endl;
#endif
- mGixs->timeStampKey(metaData.mAuthorId) ;
+ mGixs->timeStampKey(metaData.mAuthorId,"Group author signature validation. GrpId=" + metaData.mGroupId.toStdString()) ;
}
else
{
@@ -1006,7 +999,7 @@ int RsGenExchange::validateGrp(RsNxsGrp* grp)
#endif
std::list peers;
peers.push_back(grp->PeerId());
- mGixs->requestKey(metaData.mAuthorId, peers);
+ mGixs->requestKey(metaData.mAuthorId, peers,"Group author signature validation. GrpId=" + metaData.mGroupId.toStdString());
return VALIDATE_FAIL_TRY_LATER;
}
}
@@ -1485,7 +1478,7 @@ void RsGenExchange::notifyNewGroups(std::vector &groups)
std::cerr << std::endl;
#endif
- GxsPendingItem gpsi(grp, grp->grpId);
+ GxsPendingItem gpsi(grp, grp->grpId,time(NULL));
mReceivedGrps.push_back(gpsi);
}
else
@@ -1623,6 +1616,10 @@ uint32_t RsGenExchange::getDefaultSyncPeriod()
}
}
+RsReputations::ReputationLevel RsGenExchange::minReputationForForwardingMessages(uint32_t group_sign_flags,uint32_t identity_sign_flags)
+{
+ return RsNetworkExchangeService::minReputationForForwardingMessages(group_sign_flags,identity_sign_flags);
+}
uint32_t RsGenExchange::getSyncPeriod(const RsGxsGroupId& grpId)
{
RS_STACK_MUTEX(mGenMtx) ;
@@ -1926,7 +1923,9 @@ bool RsGenExchange::processGrpMask(const RsGxsGroupId& grpId, ContentValue &grpC
void RsGenExchange::publishMsgs()
{
- RS_STACK_MUTEX(mGenMtx) ;
+ RS_STACK_MUTEX(mGenMtx) ;
+
+ time_t now = time(NULL);
// stick back msgs pending signature
typedef std::map > PendSignMap;
@@ -1995,22 +1994,20 @@ void RsGenExchange::publishMsgs()
// sign attempt
if(pit == mMsgPendingSign.end())
{
- GxsPendingItem gsi(msgItem, token);
+ GxsPendingItem gsi(msgItem, token,time(NULL));
mMsgPendingSign.insert(std::make_pair(token, gsi));
}
else
{
// remove from attempts queue if over sign
// attempts limit
- if(pit->second.mAttempts == SIGN_MAX_ATTEMPTS)
+ if(pit->second.mFirstTryTS + SIGN_MAX_WAITING_TIME < now)
{
+ std::cerr << "Pending signature grp=" << pit->second.mItem->meta.mGroupId << ", msg=" << pit->second.mItem->meta.mMsgId << ", has exceeded validation time limit. The author's key can probably not be obtained. This is unexpected." << std::endl;
+
mMsgPendingSign.erase(token);
tryLater = false;
}
- else
- {
- ++pit->second.mAttempts;
- }
}
createOk = false;
@@ -2656,28 +2653,22 @@ void RsGenExchange::processRecvdMessages()
{
RS_STACK_MUTEX(mGenMtx) ;
+ time_t now = time(NULL);
+
#ifdef GEN_EXCH_DEBUG
if(!mMsgPendingValidate.empty())
std::cerr << "processing received messages" << std::endl;
#endif
NxsMsgPendingVect::iterator pend_it = mMsgPendingValidate.begin();
-#ifdef GEN_EXCH_DEBUG
- if(!mMsgPendingValidate.empty())
- std::cerr << " pending validation" << std::endl;
-#endif
for(; pend_it != mMsgPendingValidate.end();)
{
GxsPendingItem& gpsi = *pend_it;
-#ifdef GEN_EXCH_DEBUG
- std::cerr << " grp=" << gpsi.mId.first << ", msg=" << gpsi.mId.second << ", attempts=" << gpsi.mAttempts ;
-#endif
- if(gpsi.mAttempts == VALIDATE_MAX_ATTEMPTS)
+ if(gpsi.mFirstTryTS + VALIDATE_MAX_WAITING_TIME < now)
{
-#ifdef GEN_EXCH_DEBUG
- std::cerr << " = max! deleting." << std::endl;
-#endif
+ std::cerr << "Pending validation grp=" << gpsi.mId.first << ", msg=" << gpsi.mId.second << ", has exceeded validation time limit. The author's key can probably not be obtained. This is unexpected." << std::endl;
+
delete gpsi.mItem;
pend_it = mMsgPendingValidate.erase(pend_it);
}
@@ -2839,16 +2830,12 @@ void RsGenExchange::processRecvdMessages()
// first check you haven't made too many attempts
- NxsMsgPendingVect::iterator vit = std::find(
- mMsgPendingValidate.begin(), mMsgPendingValidate.end(), id);
+ NxsMsgPendingVect::iterator vit = std::find(mMsgPendingValidate.begin(), mMsgPendingValidate.end(), id);
if(vit == mMsgPendingValidate.end())
{
- GxsPendingItem item(msg, id);
+ GxsPendingItem item(msg, id,time(NULL));
mMsgPendingValidate.push_back(item);
- }else
- {
- vit->mAttempts++;
}
}
}
@@ -2981,18 +2968,16 @@ void RsGenExchange::processRecvdGroups()
std::cerr << " failed to validate incoming grp, trying again. grpId: " << grp->grpId << std::endl;
#endif
- if(gpsi.mAttempts == VALIDATE_MAX_ATTEMPTS)
+ if(gpsi.mFirstTryTS + VALIDATE_MAX_WAITING_TIME < time(NULL))
{
#ifdef GEN_EXCH_DEBUG
- std::cerr << " max attempts " << VALIDATE_MAX_ATTEMPTS << " reached. Will delete group " << grp->grpId << std::endl;
+ std::cerr << " validation time got group " << grp->grpId << " exceeded maximum. Will delete group " << std::endl;
#endif
delete grp;
erase = true;
}
else
- {
erase = false;
- }
}
}
else
@@ -3147,7 +3132,7 @@ bool RsGenExchange::updateValid(RsGxsGrpMetaData& oldGrpMeta, RsNxsGrp& newGrp)
// also check this is the latest published group
bool latest = newGrp.metaData->mPublishTs > oldGrpMeta.mPublishTs;
- mGixs->timeStampKey(newGrp.metaData->mAuthorId) ;
+ mGixs->timeStampKey(newGrp.metaData->mAuthorId,"Validation of signature for updated grp " + oldGrpMeta.mGroupId.toStdString()) ;
return GxsSecurity::validateNxsGrp(newGrp, adminSign, keyMit->second) && latest;
}
diff --git a/libretroshare/src/gxs/rsgenexchange.h b/libretroshare/src/gxs/rsgenexchange.h
index a391d47e0..735e8ec38 100644
--- a/libretroshare/src/gxs/rsgenexchange.h
+++ b/libretroshare/src/gxs/rsgenexchange.h
@@ -43,17 +43,10 @@ template
class GxsPendingItem
{
public:
- GxsPendingItem(GxsItem item, Identity id) :
- mItem(item), mId(id), mAttempts(0)
+ GxsPendingItem(GxsItem item, Identity id,time_t ts) :
+ mItem(item), mId(id), mFirstTryTS(ts)
{}
- GxsPendingItem(const GxsPendingItem& gpsi)
- {
- this->mItem = gpsi.mItem;
- this->mId = gpsi.mId;
- this->mAttempts = gpsi.mAttempts;
- }
-
bool operator==(const Identity& id)
{
return this->mId == id;
@@ -61,7 +54,7 @@ public:
GxsItem mItem;
Identity mId;
- uint8_t mAttempts;
+ time_t mFirstTryTS;
};
class GxsGrpPendingSign
@@ -656,6 +649,9 @@ public:
virtual void setSyncPeriod(const RsGxsGroupId& grpId,uint32_t age_in_secs) ;
uint16_t serviceType() const { return mServType ; }
+ uint32_t serviceFullType() const { return ((uint32_t)mServType << 8) + (((uint32_t) RS_PKT_VERSION_SERVICE) << 24); }
+
+ virtual RsReputations::ReputationLevel minReputationForForwardingMessages(uint32_t group_sign_flags,uint32_t identity_flags);
protected:
/** Notifications **/
@@ -880,9 +876,9 @@ private:
private:
- const uint8_t CREATE_FAIL, CREATE_SUCCESS, CREATE_FAIL_TRY_LATER, SIGN_MAX_ATTEMPTS;
+ const uint8_t CREATE_FAIL, CREATE_SUCCESS, CREATE_FAIL_TRY_LATER, SIGN_MAX_WAITING_TIME;
const uint8_t SIGN_FAIL, SIGN_SUCCESS, SIGN_FAIL_TRY_LATER;
- const uint8_t VALIDATE_FAIL, VALIDATE_SUCCESS, VALIDATE_FAIL_TRY_LATER, VALIDATE_MAX_ATTEMPTS;
+ const uint8_t VALIDATE_FAIL, VALIDATE_SUCCESS, VALIDATE_FAIL_TRY_LATER, VALIDATE_MAX_WAITING_TIME;
private:
diff --git a/libretroshare/src/gxs/rsgixs.h b/libretroshare/src/gxs/rsgixs.h
index 5b12aa873..a210064c2 100644
--- a/libretroshare/src/gxs/rsgixs.h
+++ b/libretroshare/src/gxs/rsgixs.h
@@ -117,7 +117,7 @@ public:
*/
virtual bool signData(const uint8_t *data,uint32_t data_size,const RsGxsId& signer_id,RsTlvKeySignature& signature,uint32_t& signing_error) = 0 ;
- virtual bool validateData(const uint8_t *data,uint32_t data_size,const RsTlvKeySignature& signature,bool force_load,uint32_t& signing_error) = 0 ;
+ virtual bool validateData(const uint8_t *data,uint32_t data_size,const RsTlvKeySignature& signature,bool force_load,const std::string& info_string,uint32_t& signing_error) = 0 ;
virtual bool encryptData(const uint8_t *clear_data,uint32_t clear_data_size,uint8_t *& encrypted_data,uint32_t& encrypted_data_size,const RsGxsId& encryption_key_id,bool force_load,uint32_t& encryption_error) = 0 ;
virtual bool decryptData(const uint8_t *encrypted_data,uint32_t encrypted_data_size,uint8_t *& clear_data,uint32_t& clear_data_size,const RsGxsId& encryption_key_id,uint32_t& encryption_error) = 0 ;
@@ -125,7 +125,7 @@ public:
virtual bool getOwnIds(std::list& ids) = 0;
virtual bool isOwnId(const RsGxsId& key_id) = 0 ;
- virtual void timeStampKey(const RsGxsId& key_id) = 0 ;
+ virtual void timeStampKey(const RsGxsId& key_id,const std::string& reason) = 0 ;
// Key related interface - used for validating msgs and groups.
/*!
@@ -149,7 +149,7 @@ public:
* @param keyref the KeyRef of the key being requested
* @return will
*/
- virtual bool requestKey(const RsGxsId &id, const std::list &peers) = 0;
+ virtual bool requestKey(const RsGxsId &id, const std::list &peers,const std::string& info) = 0;
virtual bool requestPrivateKey(const RsGxsId &id) = 0;
diff --git a/libretroshare/src/gxs/rsgxsnetservice.cc b/libretroshare/src/gxs/rsgxsnetservice.cc
index 4c9291e7d..089f97a8c 100644
--- a/libretroshare/src/gxs/rsgxsnetservice.cc
+++ b/libretroshare/src/gxs/rsgxsnetservice.cc
@@ -1954,8 +1954,6 @@ void RsGxsNetService::updateServerSyncTS()
for(std::map::const_iterator mit = gxsMap.begin();mit != gxsMap.end(); ++mit)
{
- //const RsGxsGroupId& grpId = mit->first;
-
// Check if the group is subscribed and restricted to a circle. If the circle has changed, update the
// global TS to reflect that change to clients who may be able to see/subscribe to that particular group.
@@ -2810,16 +2808,13 @@ void RsGxsNetService::locked_genReqMsgTransaction(NxsTransaction* tr)
if(reqListSize < (int)MAX_REQLIST_SIZE && msgIdSet.find(msgId) == msgIdSet.end())
{
- // if reputation is in reputations cache then proceed
- // or if there isn't an author (note as author requirement is
- // enforced at service level, if no author is needed then reputation
- // filtering is optional)
bool noAuthor = syncItem->authorId.isNull();
#ifdef NXS_NET_DEBUG_1
GXSNETDEBUG_PG(item->PeerId(),grpId) << ", reqlist size=" << reqListSize << ", message not present." ;
#endif
// grp meta must be present if author present
+
if(!noAuthor && grpMeta == NULL)
{
#ifdef NXS_NET_DEBUG_1
@@ -2828,7 +2823,13 @@ void RsGxsNetService::locked_genReqMsgTransaction(NxsTransaction* tr)
continue;
}
- if(rsIdentity && rsIdentity->isBanned(syncItem->authorId))
+ // The algorithm on request of message is:
+ //
+ // - always re-check for author ban level
+ // - 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)
{
#ifdef NXS_NET_DEBUG_1
GXSNETDEBUG_PG(item->PeerId(),grpId) << ", Identity " << syncItem->authorId << " is banned. Not requesting message!" << std::endl;
@@ -2844,7 +2845,7 @@ void RsGxsNetService::locked_genReqMsgTransaction(NxsTransaction* tr)
continue ;
}
-
+#ifdef TO_BE_REMOVED
if(mReputations->haveReputation(syncItem->authorId) || noAuthor)
{
GixsReputation rep;
@@ -2859,17 +2860,20 @@ void RsGxsNetService::locked_genReqMsgTransaction(NxsTransaction* tr)
// at genexchange side of things
if(rep.score >= (int)grpMeta->mReputationCutOff || noAuthor)
{
-#ifdef NXS_NET_DEBUG_1
- GXSNETDEBUG_PG(item->PeerId(),grpId) << ", passed! Adding message to req list." << std::endl;
#endif
- RsNxsSyncMsgItem* msgItem = new RsNxsSyncMsgItem(mServType);
- msgItem->grpId = grpId;
- msgItem->msgId = msgId;
- msgItem->flag = RsNxsSyncMsgItem::FLAG_REQUEST;
- msgItem->transactionNumber = transN;
- msgItem->PeerId(peerFrom);
- reqList.push_back(msgItem);
- ++reqListSize ;
+#ifdef NXS_NET_DEBUG_1
+ GXSNETDEBUG_PG(item->PeerId(),grpId) << ", passed! Adding message to req list." << std::endl;
+#endif
+ RsNxsSyncMsgItem* msgItem = new RsNxsSyncMsgItem(mServType);
+ msgItem->grpId = grpId;
+ msgItem->msgId = msgId;
+ msgItem->flag = RsNxsSyncMsgItem::FLAG_REQUEST;
+ msgItem->transactionNumber = transN;
+ msgItem->PeerId(peerFrom);
+ reqList.push_back(msgItem);
+ ++reqListSize ;
+
+#ifdef TO_BE_REMOVED
}
#ifdef NXS_NET_DEBUG_1
else
@@ -2889,6 +2893,7 @@ void RsGxsNetService::locked_genReqMsgTransaction(NxsTransaction* tr)
entry.mMsgId = syncItem->msgId;
toVet.push_back(entry);
}
+#endif
}
#ifdef NXS_NET_DEBUG_1
else
@@ -3061,13 +3066,14 @@ void RsGxsNetService::locked_genReqGrpTransaction(NxsTransaction* tr)
}
// FIXTESTS global variable rsReputations not available in unittests!
- if(!grpSyncItem->authorId.isNull() && rsIdentity && rsIdentity->isBanned(grpSyncItem->authorId))
- {
+#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)
+ {
#ifdef NXS_NET_DEBUG_0
- GXSNETDEBUG_PG(tr->mTransaction->PeerId(),grpId) << " Identity " << grpSyncItem->authorId << " is banned. Not syncing group." << std::endl;
+ GXSNETDEBUG_PG(tr->mTransaction->PeerId(),grpId) << " Identity " << grpSyncItem->authorId << " is banned. Not syncing group." << std::endl;
#endif
- continue ;
- }
+ continue ;
+ }
if( (mGrpAutoSync && !haveItem) || latestVersion)
{
@@ -4202,59 +4208,83 @@ void RsGxsNetService::handleRecvSyncMessage(RsNxsSyncMsgReqItem *item,bool item_
uint32_t transN = locked_getTransactionId();
RsGxsCircleId should_encrypt_to_this_circle_id ;
+ time_t now = time(NULL) ;
+
+ uint32_t max_send_delay = mServerGrpConfigMap[item->grpId].msg_req_delay; // we should use "sync" but there's only one variable used in the GUI: the req one.
+
if(canSendMsgIds(msgMetas, *grpMeta, peer, should_encrypt_to_this_circle_id))
{
for(std::vector::iterator vit = msgMetas.begin();vit != msgMetas.end(); ++vit)
- if(item->createdSinceTS < (*vit)->mPublishTs)
+ {
+ RsGxsMsgMetaData* m = *vit;
+
+ RsIdentityDetails details ;
+
+ if(!rsIdentity->getIdDetails(m->mAuthorId,details))
{
- RsGxsMsgMetaData* m = *vit;
-
- RsNxsSyncMsgItem* mItem = new RsNxsSyncMsgItem(mServType);
- mItem->flag = RsNxsSyncGrpItem::FLAG_RESPONSE;
- mItem->grpId = m->mGroupId;
- mItem->msgId = m->mMsgId;
- mItem->authorId = m->mAuthorId;
- mItem->PeerId(peer);
- mItem->transactionNumber = transN;
-
- if(!should_encrypt_to_this_circle_id.isNull())
- {
-#ifdef NXS_NET_DEBUG_7
- GXSNETDEBUG_PG(item->PeerId(),item->grpId) << " sending info item for msg id " << mItem->msgId << ". Transaction will be encrypted for group " << should_encrypt_to_this_circle_id << std::endl;
-#endif
- RsNxsItem *encrypted_item = NULL ;
- uint32_t status = RS_NXS_ITEM_ENCRYPTION_STATUS_UNKNOWN ;
-
- if(encryptSingleNxsItem(mItem, grpMeta->mCircleId,m->mGroupId, encrypted_item,status))
- {
- itemL.push_back(encrypted_item) ;
- delete mItem ;
- }
- else
- {
- // Something's not ready (probably the circle content. We could put on a vetting list, but actually the client will re-ask the list asap.
-
- std::cerr << " (EE) Cannot encrypt msg meta data. MsgId=" << mItem->msgId << ", grpId=" << mItem->grpId << ", circleId=" << should_encrypt_to_this_circle_id << ". Dropping the whole list." << std::endl;
-
- for(std::list::const_iterator it(itemL.begin());it!=itemL.end();++it)
- delete *it ;
-
- itemL.clear() ;
- break ;
- }
- }
- else
- {
-#ifdef NXS_NET_DEBUG_7
- GXSNETDEBUG_PG(item->PeerId(),item->grpId) << " sending info item for msg id " << mItem->msgId << " in clear." << std::endl;
-#endif
- itemL.push_back(mItem);
- }
+ std::cerr << /* GXSNETDEBUG_PG(item->PeerId(),item->grpId) << */ " not sending grp message ID " << (*vit)->mMsgId << ", because the identity of the author is not accessible (unknown/not cached)" << std::endl;
+ continue ;
}
+
+ if(details.mReputation.mOverallReputationLevel < minReputationForForwardingMessages(grpMeta->mSignFlags, details.mFlags))
+ {
+//#ifdef NXS_NET_DEBUG_0
+ std::cerr << /* GXSNETDEBUG_PG(item->PeerId(),item->grpId) << */ " not sending item ID " << (*vit)->mMsgId << ", because the author is flags " << std::hex << details.mFlags << std::dec << " and reputation level " << details.mReputation.mOverallReputationLevel << std::endl;
+//#endif
+ continue ;
+ }
+ // Check publish TS
+
+ if(item->createdSinceTS > (*vit)->mPublishTs || (*vit)->mPublishTs + max_send_delay < now)
+ {
#ifdef NXS_NET_DEBUG_0
- else
- GXSNETDEBUG_PG(item->PeerId(),item->grpId) << " not sending item ID " << (*vit)->mMsgId << ", because it is too old (publishTS = " << (time(NULL)-(*vit)->mPublishTs)/86400 << " days ago" << std::endl;
+ GXSNETDEBUG_PG(item->PeerId(),item->grpId) << " not sending item ID " << (*vit)->mMsgId << ", because it is too old (publishTS = " << (time(NULL)-(*vit)->mPublishTs)/86400 << " days ago" << std::endl;
#endif
+ continue ;
+ }
+
+ RsNxsSyncMsgItem* mItem = new RsNxsSyncMsgItem(mServType);
+ mItem->flag = RsNxsSyncGrpItem::FLAG_RESPONSE;
+ mItem->grpId = m->mGroupId;
+ mItem->msgId = m->mMsgId;
+ mItem->authorId = m->mAuthorId;
+ mItem->PeerId(peer);
+ mItem->transactionNumber = transN;
+
+ if(!should_encrypt_to_this_circle_id.isNull())
+ {
+#ifdef NXS_NET_DEBUG_7
+ GXSNETDEBUG_PG(item->PeerId(),item->grpId) << " sending info item for msg id " << mItem->msgId << ". Transaction will be encrypted for group " << should_encrypt_to_this_circle_id << std::endl;
+#endif
+ RsNxsItem *encrypted_item = NULL ;
+ uint32_t status = RS_NXS_ITEM_ENCRYPTION_STATUS_UNKNOWN ;
+
+ if(encryptSingleNxsItem(mItem, grpMeta->mCircleId,m->mGroupId, encrypted_item,status))
+ {
+ itemL.push_back(encrypted_item) ;
+ delete mItem ;
+ }
+ else
+ {
+ // Something's not ready (probably the circle content. We could put on a vetting list, but actually the client will re-ask the list asap.
+
+ std::cerr << " (EE) Cannot encrypt msg meta data. MsgId=" << mItem->msgId << ", grpId=" << mItem->grpId << ", circleId=" << should_encrypt_to_this_circle_id << ". Dropping the whole list." << std::endl;
+
+ for(std::list::const_iterator it(itemL.begin());it!=itemL.end();++it)
+ delete *it ;
+
+ itemL.clear() ;
+ break ;
+ }
+ }
+ else
+ {
+#ifdef NXS_NET_DEBUG_7
+ GXSNETDEBUG_PG(item->PeerId(),item->grpId) << " sending info item for msg id " << mItem->msgId << " in clear." << std::endl;
+#endif
+ itemL.push_back(mItem);
+ }
+ }
}
#ifdef NXS_NET_DEBUG_0
else
diff --git a/libretroshare/src/gxs/rsgxsutil.cc b/libretroshare/src/gxs/rsgxsutil.cc
index 29c9ae337..694f34972 100644
--- a/libretroshare/src/gxs/rsgxsutil.cc
+++ b/libretroshare/src/gxs/rsgxsutil.cc
@@ -139,7 +139,7 @@ bool RsGxsIntegrityCheck::check()
GxsMsgReq msgIds;
GxsMsgReq grps;
- std::set used_gxs_ids ;
+ std::map used_gxs_ids ;
std::set subscribed_groups ;
// compute hash and compare to stored value, if it fails then simply add it
@@ -171,8 +171,8 @@ bool RsGxsIntegrityCheck::check()
GXSUTIL_DEBUG() << "TimeStamping group authors' key ID " << grp->metaData->mAuthorId << " in group ID " << grp->grpId << std::endl;
#endif
- if(rsIdentity!=NULL && !rsIdentity->isBanned(grp->metaData->mAuthorId))
- used_gxs_ids.insert(grp->metaData->mAuthorId) ;
+ if(rsIdentity!=NULL && rsIdentity->overallReputationLevel(grp->metaData->mAuthorId) > RsReputations::REPUTATION_LOCALLY_NEGATIVE)
+ used_gxs_ids.insert(std::make_pair(grp->metaData->mAuthorId,grp->grpId)) ;
}
}
}
@@ -269,8 +269,8 @@ bool RsGxsIntegrityCheck::check()
#ifdef DEBUG_GXSUTIL
GXSUTIL_DEBUG() << "TimeStamping message authors' key ID " << msg->metaData->mAuthorId << " in message " << msg->msgId << ", group ID " << msg->grpId<< std::endl;
#endif
- if(rsIdentity!=NULL && !rsIdentity->isBanned(msg->metaData->mAuthorId))
- used_gxs_ids.insert(msg->metaData->mAuthorId) ;
+ if(rsIdentity!=NULL && rsIdentity->overallReputationLevel(msg->metaData->mAuthorId) > RsReputations::REPUTATION_LOCALLY_NEGATIVE)
+ used_gxs_ids.insert(std::make_pair(msg->metaData->mAuthorId,msg->metaData->mGroupId)) ;
}
delete msg;
@@ -297,9 +297,9 @@ bool RsGxsIntegrityCheck::check()
std::list connected_friends ;
rsPeers->getOnlineList(connected_friends) ;
- std::vector gxs_ids ;
+ std::vector > gxs_ids ;
- for(std::set::const_iterator it(used_gxs_ids.begin());it!=used_gxs_ids.end();++it)
+ for(std::map::const_iterator it(used_gxs_ids.begin());it!=used_gxs_ids.end();++it)
{
gxs_ids.push_back(*it) ;
#ifdef DEBUG_GXSUTIL
@@ -321,9 +321,9 @@ bool RsGxsIntegrityCheck::check()
GXSUTIL_DEBUG() << " requesting ID " << gxs_ids[n] ;
#endif
- if(!mGixs->haveKey(gxs_ids[n])) // checks if we have it already in the cache (conservative way to ensure that we atually have it)
+ if(!mGixs->haveKey(gxs_ids[n].first)) // checks if we have it already in the cache (conservative way to ensure that we atually have it)
{
- mGixs->requestKey(gxs_ids[n],connected_friends);
+ mGixs->requestKey(gxs_ids[n].first,connected_friends,"Author in service \"" + rsServiceControl->getServiceName(mGenExchangeClient->serviceFullType())+"\" (group ID " + gxs_ids[n].second.toStdString() + ")" ) ;
++nb_requested_not_in_cache ;
#ifdef DEBUG_GXSUTIL
@@ -335,12 +335,8 @@ bool RsGxsIntegrityCheck::check()
#ifdef DEBUG_GXSUTIL
GXSUTIL_DEBUG() << " ... already in cache" << std::endl;
#endif
-
- // Note: we could time_stamp even in the case where the id is not cached. Anyway, it's not really a problem here, since IDs have a high chance of
- // behing eventually stamped.
-
- mGixs->timeStampKey(gxs_ids[n]) ;
}
+ mGixs->timeStampKey(gxs_ids[n].first,"Author in service \"" + rsServiceControl->getServiceName(mGenExchangeClient->serviceFullType())+"\" (group ID " + gxs_ids[n].second.toStdString() + ")");
gxs_ids[n] = gxs_ids[gxs_ids.size()-1] ;
gxs_ids.pop_back() ;
diff --git a/libretroshare/src/gxs/rsnxs.h b/libretroshare/src/gxs/rsnxs.h
index 0613560b0..9b879d2d0 100644
--- a/libretroshare/src/gxs/rsnxs.h
+++ b/libretroshare/src/gxs/rsnxs.h
@@ -34,6 +34,8 @@
#include
Afterwards you can unsubscribe from the context menu of the forum list at left.
"));
ui->threadTreeWidget->enableColumnCustomize(true);
+
}
GxsForumThreadWidget::~GxsForumThreadWidget()
@@ -415,12 +472,23 @@ void GxsForumThreadWidget::threadListCustomPopupMenu(QPoint /*point*/)
QAction *replyAct = new QAction(QIcon(IMAGE_MESSAGEREPLY), tr("Reply"), &contextMnu);
connect(replyAct, SIGNAL(triggered()), this, SLOT(replytoforummessage()));
- QAction *replyauthorAct = new QAction(QIcon(IMAGE_MESSAGEREPLY), tr("Reply with private message"), &contextMnu);
+ QAction *replyauthorAct = new QAction(QIcon(IMAGE_MESSAGEREPLY), tr("Reply to author with private message"), &contextMnu);
connect(replyauthorAct, SIGNAL(triggered()), this, SLOT(replytomessage()));
- QAction *flagasbadAct = new QAction(QIcon(IMAGE_BIOHAZARD), tr("Ban this author"), &contextMnu);
- flagasbadAct->setToolTip(tr("This will block/hide messages from this person, and notify neighbor nodes.")) ;
- connect(flagasbadAct, SIGNAL(triggered()), this, SLOT(flagpersonasbad()));
+ QAction *flagaspositiveAct = new QAction(QIcon(IMAGE_POSITIVE_OPINION), tr("Give positive opinion"), &contextMnu);
+ flagaspositiveAct->setToolTip(tr("This will block/hide messages from this person, and notify friend nodes.")) ;
+ flagaspositiveAct->setData(mTokenTypePositiveAuthor) ;
+ connect(flagaspositiveAct, SIGNAL(triggered()), this, SLOT(flagperson()));
+
+ QAction *flagasneutralAct = new QAction(QIcon(IMAGE_NEUTRAL_OPINION), tr("Give neutral opinion"), &contextMnu);
+ flagasneutralAct->setToolTip(tr("Doing this, you trust your friends to decide to forward this message or not.")) ;
+ flagasneutralAct->setData(mTokenTypeNeutralAuthor) ;
+ connect(flagasneutralAct, SIGNAL(triggered()), this, SLOT(flagperson()));
+
+ QAction *flagasnegativeAct = new QAction(QIcon(IMAGE_NEGATIVE_OPINION), tr("Give negative opinion"), &contextMnu);
+ flagasnegativeAct->setToolTip(tr("This will block/hide messages from this person, and notify friend nodes.")) ;
+ flagasnegativeAct->setData(mTokenTypeNegativeAuthor) ;
+ connect(flagasnegativeAct, SIGNAL(triggered()), this, SLOT(flagperson()));
QAction *newthreadAct = new QAction(QIcon(IMAGE_MESSAGE), tr("Start New Thread"), &contextMnu);
newthreadAct->setEnabled (IS_GROUP_SUBSCRIBED(mSubscribeFlags));
@@ -444,6 +512,9 @@ void GxsForumThreadWidget::threadListCustomPopupMenu(QPoint /*point*/)
QAction *markMsgAsUnreadChildren = new QAction(QIcon(":/images/message-mail.png"), tr("Mark as unread") + " (" + tr ("with children") + ")", &contextMnu);
connect(markMsgAsUnreadChildren, SIGNAL(triggered()), this, SLOT(markMsgAsUnreadChildren()));
+ QAction *showinpeopleAct = new QAction(QIcon(":/images/message-mail.png"), tr("Show author in people tab"), &contextMnu);
+ connect(showinpeopleAct, SIGNAL(triggered()), this, SLOT(showInPeopleTab()));
+
if (IS_GROUP_SUBSCRIBED(mSubscribeFlags)) {
QList rows;
QList rowsRead;
@@ -501,8 +572,13 @@ void GxsForumThreadWidget::threadListCustomPopupMenu(QPoint /*point*/)
contextMnu.addAction(collapseAll);
contextMnu.addSeparator();
- contextMnu.addAction(flagasbadAct);
- contextMnu.addSeparator();
+
+ QMenu *submenu1 = contextMnu.addMenu(tr("Author's reputation")) ;
+ submenu1->addAction(flagaspositiveAct);
+ submenu1->addAction(flagasneutralAct);
+ submenu1->addAction(flagasnegativeAct);
+ contextMnu.addAction(showinpeopleAct);
+
contextMnu.addAction(replyauthorAct);
contextMnu.exec(QCursor::pos());
@@ -794,8 +870,8 @@ static QString getDurationString(uint32_t days)
tw->ui->forumName->setText(QString::fromUtf8(group.mMeta.mGroupName.c_str()));
QString anti_spam_features1 ;
- if(IS_GROUP_PGP_KNOWN_AUTHED(tw->mSignFlags)) anti_spam_features1 = tr("Anonymous/unknown node IDs reputation threshold set to 0.4");
- else if(IS_GROUP_PGP_AUTHED(tw->mSignFlags)) anti_spam_features1 = tr("Anonymous IDs reputation threshold set to 0.4");
+ if(IS_GROUP_PGP_KNOWN_AUTHED(tw->mSignFlags)) anti_spam_features1 = tr("Anonymous/unknown posts forwarded if reputation is positive");
+ else if(IS_GROUP_PGP_AUTHED(tw->mSignFlags)) anti_spam_features1 = tr("Anonymous posts forwarded if reputation is positive");
tw->mForumDescription = QString("%1: \t%2
").arg(tr("Forum name"), QString::fromUtf8( group.mMeta.mGroupName.c_str()));
tw->mForumDescription += QString("%1: \t%2
").arg(tr("Subscribers")).arg(group.mMeta.mPop);
@@ -996,18 +1072,54 @@ QTreeWidgetItem *GxsForumThreadWidget::convertMsgToThreadWidget(const RsGxsForum
// Early check for a message that should be hidden because its author
// is flagged with a bad reputation
+ RsIdentityDetails iddetails ;
- bool redacted = rsIdentity->isBanned(msg.mMeta.mAuthorId) ;
+ RsReputations::ReputationLevel reputation_level = RsReputations::REPUTATION_NEUTRAL ;
+ bool redacted = false ;
- GxsIdRSTreeWidgetItem *item = new GxsIdRSTreeWidgetItem(mThreadCompareRole,GxsIdDetails::ICON_TYPE_ALL || (redacted?(GxsIdDetails::ICON_TYPE_REDACTED):0));
+ if(rsIdentity->getIdDetails(msg.mMeta.mAuthorId,iddetails))
+ {
+ reputation_level = iddetails.mReputation.mOverallReputationLevel ;
+ redacted = (reputation_level == RsReputations::REPUTATION_LOCALLY_NEGATIVE) ;
+ }
+ else
+ reputation_level = RsReputations::REPUTATION_UNKNOWN ;
+
+ GxsIdRSTreeWidgetItem *item = new GxsIdRSTreeWidgetItem(mThreadCompareRole,GxsIdDetails::ICON_TYPE_AVATAR );
item->moveToThread(ui->threadTreeWidget->thread());
-
if(redacted)
item->setText(COLUMN_THREAD_TITLE, tr("[ ... Redacted message ... ]"));
else
item->setText(COLUMN_THREAD_TITLE, QString::fromUtf8(msg.mMeta.mMsgName.c_str()));
+ QString rep_tooltip_str ;
+ uint32_t rep_warning_level ;
+
+ if(reputation_level == RsReputations::REPUTATION_UNKNOWN)
+ {
+ rep_warning_level = 3 ;
+ rep_tooltip_str = tr("Information for this identity is currently missing.") ;
+ }
+ else if(reputation_level == RsReputations::REPUTATION_LOCALLY_NEGATIVE)
+ {
+ rep_warning_level = 2 ;
+ rep_tooltip_str = tr("You have banned this ID. The message will not be\ndisplayed nor forwarded to your friends.") ;
+ }
+ else if(reputation_level < rsGxsForums->minReputationForForwardingMessages(mForumGroup.mMeta.mSignFlags,iddetails.mFlags))
+ {
+ rep_warning_level = 1 ;
+ rep_tooltip_str = tr("You have not set an opinion for this person,\n and your friends do not vote positively: Spam regulation \nprevents the message to be forwarded to your friends.") ;
+ }
+ else
+ {
+ rep_warning_level = 0 ;
+ rep_tooltip_str = tr("Message will be forwarded to your friends.") ;
+ }
+ std::cerr << "Inserting post from ID " << msg.mMeta.mAuthorId << ", group flags=" << std::hex << mForumGroup.mMeta.mSignFlags << " Identity flags = " << iddetails.mFlags << ": warning level = " << rep_warning_level << std::dec << std::endl;
+
+ item->setData(COLUMN_THREAD_DISTRIBUTION,Qt::ToolTipRole,rep_tooltip_str) ;
+ item->setData(COLUMN_THREAD_DISTRIBUTION,Qt::DecorationRole,rep_warning_level) ;
//msg.mMeta.mChildTs Was not updated when received new child
// so do it here.
@@ -1096,7 +1208,7 @@ QTreeWidgetItem *GxsForumThreadWidget::convertMsgToThreadWidget(const RsGxsForum
QTreeWidgetItem *GxsForumThreadWidget::generateMissingItem(const RsGxsMessageId &msgId)
{
- GxsIdRSTreeWidgetItem *item = new GxsIdRSTreeWidgetItem(mThreadCompareRole,GxsIdDetails::ICON_TYPE_ALL);
+ GxsIdRSTreeWidgetItem *item = new GxsIdRSTreeWidgetItem(mThreadCompareRole,GxsIdDetails::ICON_TYPE_AVATAR);
item->setText(COLUMN_THREAD_TITLE, tr("[ ... Missing Message ... ]"));
item->setData(COLUMN_THREAD_DATA, ROLE_THREAD_MSGID, QString::fromStdString(msgId.toStdString()));
@@ -1431,7 +1543,8 @@ void GxsForumThreadWidget::insertMessageData(const RsGxsForumMsg &msg)
return;
}
- bool redacted = rsIdentity->isBanned(msg.mMeta.mAuthorId) ;
+ uint32_t overall_reputation = rsIdentity->overallReputationLevel(msg.mMeta.mAuthorId) ;
+ bool redacted = (overall_reputation == RsReputations::REPUTATION_LOCALLY_NEGATIVE) ;
mStateHelper->setActive(mTokenTypeMessageData, true);
@@ -1644,6 +1757,17 @@ void GxsForumThreadWidget::setMsgReadStatus(QList &rows, bool
}
}
+void GxsForumThreadWidget::showInPeopleTab()
+{
+ if (groupId().isNull() || mThreadId.isNull()) {
+ QMessageBox::information(this, tr("RetroShare"),tr("You cant act on the author to a non-existant Message"));
+ return;
+ }
+
+ RsGxsGrpMsgIdPair postId = std::make_pair(groupId(), mThreadId);
+ requestMsgData_ShowAuthorInPeople(postId) ;
+}
+
void GxsForumThreadWidget::markMsgAsReadUnread (bool read, bool children, bool forum)
{
if (groupId().isNull() || !IS_GROUP_SUBSCRIBED(mSubscribeFlags)) {
@@ -1827,24 +1951,26 @@ static QString buildReplyHeader(const RsMsgMetaData &meta)
return header;
}
-void GxsForumThreadWidget::flagpersonasbad()
+void GxsForumThreadWidget::flagperson()
{
- // no need to use the token system for that, since we just need to find out the author's name, which is in the item.
-
+ // no need to use the token system for that, since we just need to find out the author's name, which is in the item.
+
if (groupId().isNull() || mThreadId.isNull()) {
QMessageBox::information(this, tr("RetroShare"),tr("You cant reply to a non-existant Message"));
return;
}
+ uint32_t token_type = qobject_cast(sender())->data().toUInt();
+
// Get Message ... then complete replyMessageData().
RsGxsGrpMsgIdPair postId = std::make_pair(groupId(), mThreadId);
-
- RsTokReqOptions opts;
+
+ RsTokReqOptions opts;
opts.mReqType = GXS_REQUEST_TYPE_MSG_DATA;
#ifdef DEBUG_FORUMS
- std::cerr << "GxsForumThreadWidget::requestMsgData_BanAuthor(" << postId.first << "," << postId.second << ")";
- std::cerr << std::endl;
+ std::cerr << "GxsForumThreadWidget::requestMsgData_BanAuthor(" << postId.first << "," << postId.second << ")";
+ std::cerr << std::endl;
#endif
GxsMsgReq msgIds;
@@ -1852,7 +1978,7 @@ void GxsForumThreadWidget::flagpersonasbad()
vect.push_back(postId.second);
uint32_t token;
- mTokenQueue->requestMsgInfo(token, RS_TOKREQ_ANSTYPE_DATA, opts, msgIds, mTokenTypeBanAuthor);
+ mTokenQueue->requestMsgInfo(token, RS_TOKREQ_ANSTYPE_DATA, opts, msgIds, token_type);
}
void GxsForumThreadWidget::replytomessage()
@@ -1907,6 +2033,18 @@ void GxsForumThreadWidget::replyMessageData(const RsGxsForumMsg &msg)
}
}
+void GxsForumThreadWidget::showAuthorInPeople(const RsGxsForumMsg& msg)
+{
+ if ((msg.mMeta.mGroupId != groupId()) || (msg.mMeta.mMsgId != mThreadId))
+ {
+ std::cerr << "GxsForumThreadWidget::replyMessageData() ERROR Message Ids have changed!";
+ std::cerr << std::endl;
+ return;
+ }
+ RsGxsGrpMsgIdPair postId = std::make_pair(groupId(), mThreadId);
+ requestMsgData_ShowAuthorInPeople(postId);
+}
+
void GxsForumThreadWidget::replyForumMessageData(const RsGxsForumMsg &msg)
{
if ((msg.mMeta.mGroupId != groupId()) || (msg.mMeta.mMsgId != mThreadId))
@@ -2069,6 +2207,8 @@ void GxsForumThreadWidget::loadGroupData(const uint32_t &token)
mStateHelper->setActive(mTokenTypeGroupData, true);
+ // Don't show the distribution column if the forum has no anti-spam
+ ui->threadTreeWidget->setColumnHidden(COLUMN_THREAD_DISTRIBUTION, !IS_GROUP_PGP_KNOWN_AUTHED(mForumGroup.mMeta.mSignFlags) && !(IS_GROUP_PGP_AUTHED(mForumGroup.mMeta.mSignFlags)));
ui->subscribeToolButton->setHidden(IS_GROUP_SUBSCRIBED(mSubscribeFlags)) ;
}
else
@@ -2158,6 +2298,24 @@ void GxsForumThreadWidget::requestMsgData_ReplyMessage(const RsGxsGrpMsgIdPair &
mTokenQueue->requestMsgInfo(token, RS_TOKREQ_ANSTYPE_DATA, opts, msgIds, mTokenTypeReplyMessage);
}
+void GxsForumThreadWidget::requestMsgData_ShowAuthorInPeople(const RsGxsGrpMsgIdPair& msgId)
+{
+ RsTokReqOptions opts;
+ opts.mReqType = GXS_REQUEST_TYPE_MSG_DATA;
+
+#ifdef DEBUG_FORUMS
+ std::cerr << "GxsForumThreadWidget::requestMsgData_ReplyMessage(" << msgId.first << "," << msgId.second << ")";
+ std::cerr << std::endl;
+#endif
+
+ GxsMsgReq msgIds;
+ std::vector &vect = msgIds[msgId.first];
+ vect.push_back(msgId.second);
+
+ uint32_t token;
+ mTokenQueue->requestMsgInfo(token, RS_TOKREQ_ANSTYPE_DATA, opts, msgIds, mTokenTypeShowAuthorInPeople);
+}
+
void GxsForumThreadWidget::requestMsgData_ReplyForumMessage(const RsGxsGrpMsgIdPair &msgId)
{
RsTokReqOptions opts;
@@ -2227,7 +2385,43 @@ void GxsForumThreadWidget::loadMsgData_ReplyForumMessage(const uint32_t &token)
}
}
-void GxsForumThreadWidget::loadMsgData_BanAuthor(const uint32_t &token)
+void GxsForumThreadWidget::loadMsgData_ShowAuthorInPeople(const uint32_t &token)
+{
+#ifdef DEBUG_FORUMS
+ std::cerr << "GxsForumThreadWidget::loadMsgData_ReplyMessage()";
+ std::cerr << std::endl;
+#endif
+
+ std::vector msgs;
+ if (rsGxsForums->getMsgData(token, msgs))
+ {
+ if (msgs.size() != 1)
+ {
+ std::cerr << "GxsForumThreadWidget::loadMsgData_showAuthorInPeople() ERROR Wrong number of answers";
+ std::cerr << std::endl;
+ return;
+ }
+
+ if(msgs[0].mMeta.mAuthorId.isNull())
+ {
+ std::cerr << "GxsForumThreadWidget::loadMsgData_showAuthorInPeople() ERROR Missing Message Data...";
+ std::cerr << std::endl;
+ }
+
+ /* window will destroy itself! */
+ IdDialog *idDialog = dynamic_cast(MainWindow::getPage(MainWindow::People));
+
+ if (!idDialog)
+ return ;
+
+ MainWindow::showWindow(MainWindow::People);
+ idDialog->navigate(RsGxsId(msgs[0].mMeta.mAuthorId));
+ }
+ else
+ std::cerr << "GxsForumThreadWidget::loadMsgData_showAuthorInPeople() ERROR Missing Message Data...";
+}
+
+void GxsForumThreadWidget::loadMsgData_SetAuthorOpinion(const uint32_t &token,RsReputations::Opinion opinion)
{
#ifdef DEBUG_FORUMS
std::cerr << "GxsForumThreadWidget::loadMsgData_BanAuthor()";
@@ -2245,7 +2439,8 @@ void GxsForumThreadWidget::loadMsgData_BanAuthor(const uint32_t &token)
}
std::cerr << " banning author id " << msgs[0].mMeta.mAuthorId << std::endl;
- rsReputations->setOwnOpinion(msgs[0].mMeta.mAuthorId,RsReputations::OPINION_NEGATIVE) ;
+
+ rsReputations->setOwnOpinion(msgs[0].mMeta.mAuthorId,opinion) ;
}
else
{
@@ -2291,8 +2486,23 @@ void GxsForumThreadWidget::loadRequest(const TokenQueue *queue, const TokenReque
return;
}
- if (req.mUserType == mTokenTypeBanAuthor) {
- loadMsgData_BanAuthor(req.mToken);
+ if (req.mUserType == mTokenTypeShowAuthorInPeople) {
+ loadMsgData_ShowAuthorInPeople(req.mToken);
+ return;
+ }
+
+ if (req.mUserType == mTokenTypePositiveAuthor) {
+ loadMsgData_SetAuthorOpinion(req.mToken,RsReputations::OPINION_POSITIVE);
+ return;
+ }
+
+ if (req.mUserType == mTokenTypeNegativeAuthor) {
+ loadMsgData_SetAuthorOpinion(req.mToken,RsReputations::OPINION_NEGATIVE);
+ return;
+ }
+
+ if (req.mUserType == mTokenTypeNeutralAuthor) {
+ loadMsgData_SetAuthorOpinion(req.mToken,RsReputations::OPINION_NEUTRAL);
return;
}
}
diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.h b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.h
index 1cf109a81..a2a6eecee 100644
--- a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.h
+++ b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.h
@@ -80,7 +80,8 @@ private slots:
void replyMessageData(const RsGxsForumMsg &msg);
void replyForumMessageData(const RsGxsForumMsg &msg);
-
+ void showAuthorInPeople(const RsGxsForumMsg& msg);
+
void saveImage();
@@ -94,6 +95,7 @@ private slots:
void markMsgAsUnreadChildren();
void copyMessageLink();
+ void showInPeopleTab();
/* handle splitter */
void togglethreadview();
@@ -108,7 +110,7 @@ private slots:
void downloadAllFiles();
void changedViewBox();
- void flagpersonasbad();
+ void flagperson();
void filterColumnChanged(int column);
void filterItems(const QString &text);
@@ -145,13 +147,15 @@ private:
static void loadAuthorIdCallback(GxsIdDetailsType type, const RsIdentityDetails &details, QObject *object, const QVariant &/*data*/);
void requestMessageData(const RsGxsGrpMsgIdPair &msgId);
- void loadMessageData(const uint32_t &token);
void requestMsgData_ReplyMessage(const RsGxsGrpMsgIdPair &msgId);
- void loadMsgData_ReplyMessage(const uint32_t &token);
-
+ void requestMsgData_ShowAuthorInPeople(const RsGxsGrpMsgIdPair &msgId);
void requestMsgData_ReplyForumMessage(const RsGxsGrpMsgIdPair &msgId);
+
+ void loadMessageData(const uint32_t &token);
+ void loadMsgData_ReplyMessage(const uint32_t &token);
void loadMsgData_ReplyForumMessage(const uint32_t &token);
- void loadMsgData_BanAuthor(const uint32_t &token);
+ void loadMsgData_ShowAuthorInPeople(const uint32_t &token);
+ void loadMsgData_SetAuthorOpinion(const uint32_t &token, RsReputations::Opinion opinion);
private:
RsGxsGroupId mLastForumID;
@@ -173,7 +177,10 @@ private:
uint32_t mTokenTypeMessageData;
uint32_t mTokenTypeReplyMessage;
uint32_t mTokenTypeReplyForumMessage;
- uint32_t mTokenTypeBanAuthor;
+ uint32_t mTokenTypeShowAuthorInPeople;
+ uint32_t mTokenTypeNegativeAuthor;
+ uint32_t mTokenTypePositiveAuthor;
+ uint32_t mTokenTypeNeutralAuthor;
/* Color definitions (for standard see qss.default) */
QColor mTextColorRead;
diff --git a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.ui b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.ui
index a086d110c..ba0dd9640 100644
--- a/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.ui
+++ b/retroshare-gui/src/gui/gxsforums/GxsForumThreadWidget.ui
@@ -6,7 +6,7 @@
0
0
- 851
+ 1217
721
@@ -238,6 +238,11 @@
Date
+
+
+ Distribution
+
+
Author
diff --git a/retroshare-gui/src/gui/icons.qrc b/retroshare-gui/src/gui/icons.qrc
index 0ba95fae7..f7ad9d574 100644
--- a/retroshare-gui/src/gui/icons.qrc
+++ b/retroshare-gui/src/gui/icons.qrc
@@ -1,149 +1,227 @@
-
- icons/svg/profile.svg
- icons/svg/download.svg
- icons/svg/folders.svg
- icons/svg/folders1.svg
- icons/svg/magnifying-glass.svg
- icons/svg/upload.svg
- icons/svg/paste.svg
- icons/svg/share.svg
- icons/settings/appearance.svg
- icons/settings/channels.svg
- icons/settings/chat.svg
- icons/settings/directories.svg
- icons/settings/filesharing.svg
- icons/settings/forums.svg
- icons/settings/general.svg
- icons/settings/messages.svg
- icons/settings/network.svg
- icons/settings/notify.svg
- icons/settings/people.svg
- icons/settings/permissions.svg
- icons/settings/plugins.svg
- icons/settings/posted.svg
- icons/settings/profile.svg
- icons/settings/server.svg
- icons/settings/sound.svg
- icons/settings/webinterface.svg
- icons/add_user_256.png
- icons/aol.png
- icons/avatar_128.png
- icons/avatar_grey_128.png
- icons/blank_red_128.png
- icons/void_128.png
- icons/blank_green_128.png
- icons/blank_blue_128.png
- icons/browsable_green_128.png
- icons/search_red_128.png
- icons/anonymous_blue_128.png
- icons/bullet_blue_128.png
- icons/bullet_green_128.png
- icons/bullet_grey_128.png
- icons/bullet_red_128.png
- icons/bullet_yellow_128.png
- icons/channels_128.png
- icons/channels_red_128.png
- icons/chat_128.png
- icons/chat_red_128.png
- icons/circles_128.png
- icons/circles_new_128.png
- icons/friends_128.png
- icons/global_switch_off_128.png
- icons/global_switch_on_128.png
- icons/gmail.png
- icons/help_128.png
- icons/help_64.png
- icons/information_128.png
- icons/internet_128.png
- icons/invite64.png
- icons/knews_128.png
- icons/knews_red_128.png
- icons/konversation_128.png
- icons/konversation128.png
- icons/konversation_red_128.png
- icons/ktorrent_128.png
- icons/ktorrent_red_128.png
- icons/logo_0_connected_128.png
- icons/logo_128.png
- icons/logo_1_connected_128.png
- icons/logo_2_connected_128.png
- icons/mail_128.png
- icons/mail_old_128.png
- icons/mail_red_128.png
- icons/newsfeed128.png
- icons/outlook.png
- icons/plugins_128.png
- icons/posted_128.png
- icons/posted_red_128.png
- icons/quit_128.png
- icons/security_high_128.png
- icons/security_low_128.png
- icons/security_medium_128.png
- icons/star_overlay_128.png
- icons/switch00_128.png
- icons/switch01_128.png
- icons/switch10_128.png
- icons/switch11_128.png
- icons/system_128.png
- icons/tile_checking_48.png
- icons/tile_downloaded_48.png
- icons/tile_downloading_48.png
- icons/tile_inactive_48.png
- icons/tor-logo.png
- icons/tor-off.png
- icons/tor-on.png
- icons/tor-starting.png
- icons/tor-stopping.png
- icons/user-away_64.png
- icons/user-away-extended_64.png
- icons/user-busy_64.png
- icons/user-offline_64.png
- icons/user-online_64.png
- icons/yahoo.png
- icons/yandex.png
- icons/yellow_biohazard64.png
- icons/png/attach.png
- icons/png/attach-image.png
- icons/png/highlight.png
- icons/png/invite.png
- icons/png/leave.png
- icons/png/search.png
- icons/png/send-message.png
- icons/png/settings.png
- icons/png/smiley.png
- icons/png/font.png
- icons/png/send-message-blocked.png
- icons/png/chat-bubble-notify.png
- icons/png/channels.png
- icons/png/chat-lobbies.png
- icons/png/forums.png
- icons/png/info.png
- icons/png/messages.png
- icons/png/network.png
- icons/png/newsfeed.png
- icons/png/people.png
- icons/png/posted.png
- icons/png/exit.png
- icons/png/options.png
- icons/png/filesharing.png
- icons/png/channels-notify.png
- icons/png/chat-lobbies-notify.png
- icons/png/forums-notify.png
- icons/png/messages-notify.png
- icons/png/network-notify.png
- icons/png/newsfeed-notify.png
- icons/png/people-notify.png
- icons/png/posted-notify.png
- icons/png/filesharing-notify.png
- icons/png/thumbs-up.png
- icons/png/thumbs-down.png
- icons/png/thumbs-neutral.png
- icons/png/add.png
- icons/png/netgraph.png
- icons/png/network-puplic.png
- icons/png/circles.png
- icons/png/person.png
- icons/png/keyring.png
-
+
+ icons/add_user_256.png
+ icons/anonymous_blue_128.png
+ icons/anonymous_green_128.png
+ icons/aol.png
+ icons/avatar_128.png
+ icons/avatar_grey_128.png
+ icons/blank_blue_128.png
+ icons/blank_green_128.png
+ icons/blank_red_128.png
+ icons/browsable_blue_128.png
+ icons/browsable_green_128.png
+ icons/bullet_blue_128.png
+ icons/bullet_green_128.png
+ icons/bullet_green_yellow_star_128.png
+ icons/bullet_grey_128.png
+ icons/bullet_red_128.png
+ icons/bullet_yellow_128.png
+ icons/channels_128.png
+ icons/channels_red_128.png
+ icons/chat_128.png
+ icons/chat_red_128.png
+ icons/circles_128.png
+ icons/circles_new_128.png
+ icons/friends_128.png
+ icons/global_switch_off_128.png
+ icons/global_switch_on_128.png
+ icons/gmail.png
+ icons/help_128.png
+ icons/help_64.png
+ icons/information_128.png
+ icons/internet_128.png
+ icons/invite64.png
+ icons/knews_128.png
+ icons/knews_red_128.png
+ icons/konversation_128.png
+ icons/konversation128.png
+ icons/konversation_red_128.png
+ icons/ktorrent_128.png
+ icons/ktorrent_red_128.png
+ icons/logo_0_connected_128.png
+ icons/logo_128.png
+ icons/logo_1_connected_128.png
+ icons/logo_2_connected_128.png
+ icons/mail_128.png
+ icons/mail_old_128.png
+ icons/mail_red_128.png
+ icons/newsfeed128.png
+ icons/outlook.png
+ icons/plugins_128.png
+ icons/png/add.png
+ icons/png/attach-image.png
+ icons/png/attach.png
+ icons/png/channels-notify.png
+ icons/png/channels.png
+ icons/png/chat-bubble-notify.png
+ icons/png/chat-bubble.png
+ icons/png/chat-lobbies-notify.png
+ icons/png/chat-lobbies.png
+ icons/png/circles.png
+ icons/png/empty-circle.png
+ icons/png/exit.png
+ icons/png/feedreader-notify.png
+ icons/png/feedreader.png
+ icons/png/filesharing-notify.png
+ icons/png/filesharing.png
+ icons/png/font.png
+ icons/png/forums-notify.png
+ icons/png/forums.png
+ icons/png/fullscreen_arrows.png
+ icons/png/highlight.png
+ icons/png/info.png
+ icons/png/invite.png
+ icons/png/keyring.png
+ icons/png/leave.png
+ icons/png/messages-notify.png
+ icons/png/messages.png
+ icons/png/microphone_mute.png
+ icons/png/microphone.png
+ icons/png/netgraph.png
+ icons/png/network-notify.png
+ icons/png/network.png
+ icons/png/network-puplic.png
+ icons/png/newsfeed-notify.png
+ icons/png/newsfeed.png
+ icons/png/options.png
+ icons/png/people-notify.png
+ icons/png/people.png
+ icons/png/person.png
+ icons/png/phone_hangup.png
+ icons/png/phone.png
+ icons/png/posted-notify.png
+ icons/png/posted.png
+ icons/png/search.png
+ icons/png/send-message-blocked.png
+ icons/png/send-message.png
+ icons/png/settings.png
+ icons/png/smiley.png
+ icons/png/speaker_mute.png
+ icons/png/speaker.png
+ icons/png/thumbs-down.png
+ icons/png/thumbs-neutral.png
+ icons/png/thumbs-up.png
+ icons/png/video.png
+ icons/posted_128.png
+ icons/posted_red_128.png
+ icons/quit_128.png
+ icons/red_biohazard64.png
+ icons/search_red_128.png
+ icons/security_high_128.png
+ icons/security_low_128.png
+ icons/security_medium_128.png
+ icons/settings/appearance.svg
+ icons/settings/channels.svg
+ icons/settings/chat.svg
+ icons/settings/directories.svg
+ icons/settings/filesharing.svg
+ icons/settings/forums.svg
+ icons/settings/general.svg
+ icons/settings/messages.svg
+ icons/settings/network.svg
+ icons/settings/notify.svg
+ icons/settings/people.svg
+ icons/settings/permissions.svg
+ icons/settings/plugins.svg
+ icons/settings/posted.svg
+ icons/settings/profile.svg
+ icons/settings/server.svg
+ icons/settings/sound.svg
+ icons/settings/webinterface.svg
+ icons/star_overlay_128.png
+ icons/svg/add.svg
+ icons/svg/attach-image.svg
+ icons/svg/attach.svg
+ icons/svg/channels-notify.svg
+ icons/svg/channels.svg
+ icons/svg/chat-bubble-notify.svg
+ icons/svg/chat-bubble.svg
+ icons/svg/chat-lobbies-notify.svg
+ icons/svg/chat-lobbies.svg
+ icons/svg/circles.svg
+ icons/svg/download.svg
+ icons/svg/empty-circle.svg
+ icons/svg/exit-red.svg
+ icons/svg/exit.svg
+ icons/svg/feedreader-notify.svg
+ icons/svg/feedreader.svg
+ icons/svg/filesharing-notify.svg
+ icons/svg/filesharing.svg
+ icons/svg/folders1.svg
+ icons/svg/folders.svg
+ icons/svg/font.svg
+ icons/svg/forums-notify.svg
+ icons/svg/forums.svg
+ icons/svg/fullscreen_arrows.svg
+ icons/svg/highlight.svg
+ icons/svg/info.svg
+ icons/svg/invite.svg
+ icons/svg/keyring.svg
+ icons/svg/leave.svg
+ icons/svg/magnifying-glass.svg
+ icons/svg/messages-notify.svg
+ icons/svg/messages.svg
+ icons/svg/microphone_mute.svg
+ icons/svg/microphone.svg
+ icons/svg/netgraph.svg
+ icons/svg/network-notify.svg
+ icons/svg/network-puplic.svg
+ icons/svg/network.svg
+ icons/svg/newsfeed-notify.svg
+ icons/svg/newsfeed.svg
+ icons/svg/options.svg
+ icons/svg/paste.svg
+ icons/svg/people-notify.svg
+ icons/svg/people.svg
+ icons/svg/person.svg
+ icons/svg/phone_hangup.svg
+ icons/svg/phone.svg
+ icons/svg/posted-notify.svg
+ icons/svg/posted.svg
+ icons/svg/profile.svg
+ icons/svg/retroshare-info.svg
+ icons/svg/retroshare-splash.svg
+ icons/svg/retroshare-symbol_black_bg.svg
+ icons/svg/retroshare-symbol_gradients.svg
+ icons/svg/retroshare-symbol-minimal.svg
+ icons/svg/search.svg
+ icons/svg/send-message-blocked.svg
+ icons/svg/send-message.svg
+ icons/svg/settings.svg
+ icons/svg/share.svg
+ icons/svg/smiley.svg
+ icons/svg/speaker_mute.svg
+ icons/svg/speaker.svg
+ icons/svg/thumbs-down.svg
+ icons/svg/thumbs-neutral.svg
+ icons/svg/thumbs-up.svg
+ icons/svg/upload.svg
+ icons/svg/video.svg
+ icons/switch00_128.png
+ icons/switch01_128.png
+ icons/switch10_128.png
+ icons/switch11_128.png
+ icons/system_128.png
+ icons/tile_checking_48.png
+ icons/tile_downloaded_48.png
+ icons/tile_downloading_48.png
+ icons/tile_inactive_48.png
+ icons/tor-logo.png
+ icons/tor-off.png
+ icons/tor-on.png
+ icons/tor-starting.png
+ icons/tor-stopping.png
+ icons/user-away_64.png
+ icons/user-away-extended_64.png
+ icons/user-busy_64.png
+ icons/user-offline_64.png
+ icons/user-online_64.png
+ icons/void_128.png
+ icons/warning_red_128.png
+ icons/warning_yellow_128.png
+ icons/yahoo.png
+ icons/yandex.png
+ icons/yellow_biohazard64.png
+
diff --git a/retroshare-gui/src/gui/icons/bullet_green_yellow_star_128.png b/retroshare-gui/src/gui/icons/bullet_green_yellow_star_128.png
new file mode 100644
index 000000000..2b49ec384
Binary files /dev/null and b/retroshare-gui/src/gui/icons/bullet_green_yellow_star_128.png differ
diff --git a/retroshare-gui/src/gui/icons/red_biohazard64.png b/retroshare-gui/src/gui/icons/red_biohazard64.png
new file mode 100644
index 000000000..eacbf9f8d
Binary files /dev/null and b/retroshare-gui/src/gui/icons/red_biohazard64.png differ
diff --git a/retroshare-gui/src/gui/icons/warning_red_128.png b/retroshare-gui/src/gui/icons/warning_red_128.png
new file mode 100644
index 000000000..3399fee0c
Binary files /dev/null and b/retroshare-gui/src/gui/icons/warning_red_128.png differ
diff --git a/retroshare-gui/src/gui/icons/warning_yellow_128.png b/retroshare-gui/src/gui/icons/warning_yellow_128.png
new file mode 100644
index 000000000..0d809ce65
Binary files /dev/null and b/retroshare-gui/src/gui/icons/warning_yellow_128.png differ
diff --git a/retroshare-gui/src/gui/icons/yellow_biohazard64.png b/retroshare-gui/src/gui/icons/yellow_biohazard64.png
index edb6fb3f2..09accbf83 100644
Binary files a/retroshare-gui/src/gui/icons/yellow_biohazard64.png and b/retroshare-gui/src/gui/icons/yellow_biohazard64.png differ
diff --git a/retroshare-gui/src/gui/settings/PeoplePage.cpp b/retroshare-gui/src/gui/settings/PeoplePage.cpp
index 6ce71233f..9a52cdb35 100644
--- a/retroshare-gui/src/gui/settings/PeoplePage.cpp
+++ b/retroshare-gui/src/gui/settings/PeoplePage.cpp
@@ -42,7 +42,8 @@ bool PeoplePage::save(QString &/*errmsg*/)
else
rsReputations->setNodeAutoPositiveOpinionForContacts(false) ;
- rsReputations->setNodeAutoBanIdentitiesLimit(ui.autoBanIdentitiesLimit_SB->value());
+ rsReputations->setThresholdForRemotelyPositiveReputation(ui.thresholdForPositive_SB->value());
+ rsReputations->setThresholdForRemotelyNegativeReputation(ui.thresholdForNegative_SB->value());
return true;
}
@@ -51,8 +52,10 @@ bool PeoplePage::save(QString &/*errmsg*/)
void PeoplePage::load()
{
bool auto_positive_contacts = rsReputations->nodeAutoPositiveOpinionForContacts() ;
- float node_auto_ban_identities_limit = rsReputations->nodeAutoBanIdentitiesLimit();
+ uint32_t threshold_for_positive = rsReputations->thresholdForRemotelyPositiveReputation();
+ uint32_t threshold_for_negative = rsReputations->thresholdForRemotelyNegativeReputation();
ui.autoPositiveOpinion_CB->setChecked(auto_positive_contacts);
- ui.autoBanIdentitiesLimit_SB->setValue(node_auto_ban_identities_limit);
+ ui.thresholdForPositive_SB->setValue(threshold_for_positive);
+ ui.thresholdForNegative_SB->setValue(threshold_for_negative);
}
diff --git a/retroshare-gui/src/gui/settings/PeoplePage.ui b/retroshare-gui/src/gui/settings/PeoplePage.ui
index 08a5c4967..133634c0c 100644
--- a/retroshare-gui/src/gui/settings/PeoplePage.ui
+++ b/retroshare-gui/src/gui/settings/PeoplePage.ui
@@ -10,13 +10,13 @@
441
-
+
-
Identities handling
-
+
-
@@ -31,30 +31,44 @@
-
-
-
-
-
+
+
-
+
- Friend average opinion below which identities are banned:
+ Difference in votes to make friends globally negative:
- -
-
+
-
+
<html><head/><body><p>The default value of -0.6 needs 3 to 4 friends to set a negative opinion in order for that identity to be banned at your own node. This is a pretty conservative value. If you want to more easily get rid of banned identities, set the value to e.g. -0.2</p></body></html>
- -1.000000000000000
+ 1
- -0.010000000000000
+ 100
-
- 0.010000000000000
+
+
+ -
+
+
+ <html><head/><body><p>The default value of -0.6 needs 3 to 4 friends to set a negative opinion in order for that identity to be banned at your own node. This is a pretty conservative value. If you want to more easily get rid of banned identities, set the value to e.g. -0.2</p></body></html>
-
- -0.600000000000000
+
+ 1
+
+
+ 100
+
+
+
+ -
+
+
+ Difference in votes to make friends globally positive: