merged upstream/master

This commit is contained in:
csoler 2017-01-04 20:24:08 +01:00
commit f72399f2a8
20 changed files with 362 additions and 178 deletions

View File

@ -1,5 +1,72 @@
retroshare06 (0.6.1-1.XXXXXX~YYYYYY) YYYYYY; urgency=low retroshare06 (0.6.1-1.XXXXXX~YYYYYY) YYYYYY; urgency=low
5469eb1 defnax Tue, 3 Jan 2017 16:43:31 +0100 Added display labels to show positive and negative votes
0ba28a2 defnax Tue, 3 Jan 2017 01:37:16 +0100 Removed Column text for Votes, Distribution replaced by icon. Set column header to "ResizeToContents" to not use much space Added new Bio hazard icons to look same like other ones
00613d4 csoler Mon, 2 Jan 2017 14:00:23 +0100 made sure we have the public keys for msg validation, as only the private key is available when we are admin/publisher of a group
a962330 csoler Sun, 1 Jan 2017 21:28:14 +0100 fixed compilation in GxsSecurity with debug flags
e883a32 csoler Sun, 1 Jan 2017 21:10:14 +0100 added more debug info in msg validation code
bb7d829 csoler Sun, 1 Jan 2017 20:54:00 +0100 fixed compilaiton in debug mode for rsgenexchange
a261094 csoler Sun, 1 Jan 2017 20:22:54 +0100 removed debug output form p3idservice
1a9f191 csoler Sun, 1 Jan 2017 18:22:01 +0100 Merge pull request #617 from csoler/v0.6-Circles2
a6ec626 csoler Sun, 1 Jan 2017 18:07:02 +0100 fixed wrong icon in GxsIdChooser
f07ebbf csoler Sun, 1 Jan 2017 17:51:03 +0100 fixed circle authentication policy
e312848 csoler Sun, 1 Jan 2017 17:50:09 +0100 added documentation of flags in GXS msg authentication policy
fcf8a35 csoler Sun, 1 Jan 2017 17:49:34 +0100 check that author id is not null before complaining that it does not exist
c71cf7a csoler Sun, 1 Jan 2017 17:47:24 +0100 removed timestamping of key that was in the wrong place
97957bd csoler Sat, 31 Dec 2016 18:20:28 +0100 fixed update problem due to forgetting that delay=0 means no time constraints
b1923dd csoler Sat, 31 Dec 2016 17:47:15 +0100 fixed compilation
6c49b3d csoler Sat, 31 Dec 2016 16:43:52 +0100 Merge pull request #616 from PhenomRetroShare/Fix_SomeNewWarnings
41386c6 Phenom Sat, 31 Dec 2016 15:17:51 +0100 Fix some new warnings
e2dfadf csoler Sat, 31 Dec 2016 14:23:37 +0100 started documentation of GXS flags. Fixed a bug in p3gxscircles authentication policy
85e6f61 csoler Sat, 31 Dec 2016 13:48:17 +0100 Merge pull request #612 from csoler/v0.6-Reputations
f8ac391 csoler Sat, 31 Dec 2016 13:42:29 +0100 better documentation of anti-spam policy
924e3bf csoler Thu, 29 Dec 2016 21:54:50 +0100 changed anti-spam policy to require a minimum of NEUTRAL to forward posts of trusted people
057e3eb csoler Thu, 29 Dec 2016 18:10:21 +0100 extended GXS sync limit to sending instead of just requesting, in order to make backward compatibility less painful
9d82a3f csoler Thu, 29 Dec 2016 15:24:31 +0100 replace mNbAttempts in signature and validation of posts by a timeout, which allows to wait for missing keys more robustly
3a45bac csoler Thu, 29 Dec 2016 15:12:58 +0100 removed unused autoBanIdentitiesLimit variable
f3f0fce csoler Thu, 29 Dec 2016 10:34:57 +0100 added load/save of new thresholds in p3gxsreputation. Removed some unused variables
fb73391 csoler Wed, 28 Dec 2016 18:58:49 +0100 added two fields in settings/people to setup the thresholds to decide between neutral and remotely positive/negative reputation
da881e1 csoler Tue, 27 Dec 2016 21:13:37 +0100 fixed setting of author reputation from forum thread menu
3a92124 csoler Tue, 27 Dec 2016 20:42:47 +0100 added method to show a given post author into the people tab
6473782 csoler Tue, 27 Dec 2016 17:17:23 +0100 added an icon for when information is missing for an ID in forum distribution
5ed879c csoler Mon, 26 Dec 2016 17:00:21 +0100 added small debug output in GxsForumThreadWidget
d8233bb csoler Mon, 26 Dec 2016 16:59:52 +0100 merged updatream/master
742a764 csoler Mon, 26 Dec 2016 15:59:53 +0100 added display of warning for non forwarded posts
811d084 csoler Sun, 25 Dec 2016 23:43:29 +0100 only show distribution column if anti-spam is enabled
c80d3ec csoler Sun, 25 Dec 2016 23:12:07 +0100 added check for reputation before sending message ids
b34ab44 csoler Sat, 24 Dec 2016 17:29:53 +0100 added menu entries to vote for/against a forum poster
d423745 csoler Sat, 24 Dec 2016 15:04:08 +0100 added column to show distribution data and moved ReputationItemDelegate to GxsIdDetails
c100775 defnax Sat, 24 Dec 2016 14:40:56 +0100 Changed Share icon on Home View
873c0e6 csoler Sat, 24 Dec 2016 14:13:02 +0100 added display of reputation in forums
e5e5909 csoler Fri, 23 Dec 2016 22:53:57 +0100 added proper display of reputation as an icon in IDDialog
72fb8f1 csoler Fri, 23 Dec 2016 17:52:02 +0100 changed the reputation system to output a level that differentiate your own opinion to your friends opinion
36453dd csoler Thu, 22 Dec 2016 22:20:07 +0100 Merge pull request #609 from G10h4ck/android_debug
8647761 defnax Thu, 22 Dec 2016 17:10:51 +0100 Changed Paste icon
1b032e0 Gio Thu, 22 Dec 2016 13:49:13 +0100 qml-app: remove deprecated usage of LibresapiLocalClient in ChatView
2c10e20 Gio Thu, 22 Dec 2016 13:47:44 +0100 qml-app: Added button to deny friendship
3de3bec Gio Thu, 22 Dec 2016 13:47:08 +0100 Cleanup #ifdef mess in RsAccountsDetail::PathDataDirectory()
06a1020 Gio Thu, 22 Dec 2016 00:33:34 +0100 Add workaround to see debug messages from native code in android service
8b9038a csoler Thu, 22 Dec 2016 11:21:49 +0100 improved display/wording of usage statstics in People
0a3ec97 csoler Thu, 22 Dec 2016 00:14:16 +0100 added statistics info for key requests
83302e0 csoler Wed, 21 Dec 2016 23:19:20 +0100 Merge pull request #607 from PhenomRetroShare/Fix_Compilation
40cf768 Phenom Wed, 21 Dec 2016 21:23:54 +0100 Fix compilation and some new warnings.
aca36a3 defnax Wed, 21 Dec 2016 19:07:57 +0100 Improving the Certificate Page for Connect Wizard: Added place holder text for Cert Field renamed some strings Improved layout for easy paste key and display the errors.
d3051ef csoler Wed, 21 Dec 2016 00:34:07 +0100 added display of usage statistics for GXS identities
f3e699a csoler Tue, 20 Dec 2016 14:08:47 +0100 fixed typo causing publishTest to fail in some cases
8de9ee8 csoler Mon, 19 Dec 2016 23:28:57 +0100 made friendly time unit returns empty string when time is 0. Fixes 46y display in search dialog
9d8690b csoler Mon, 19 Dec 2016 21:46:55 +0100 Merge pull request #606 from csoler/v0.6-GXS-LimitedSync2
948b88b csoler Mon, 19 Dec 2016 21:40:04 +0100 fixed bug caused by calling clear in constructor which would reset the TS in GXS when saving...
c9511c4 defnax Mon, 19 Dec 2016 20:52:24 +0100 update emotes strings
ef0850e csoler Mon, 19 Dec 2016 20:44:15 +0100 added recording system for usage cases of GXS ids
0cbe83e thunder2 Sun, 18 Dec 2016 12:30:27 +0100 Added auto-login as default in Windows build script
ed61d72 csoler Sat, 17 Dec 2016 19:10:13 +0100 fixed compilaiton
330cc98 csoler Sat, 17 Dec 2016 18:14:44 +0100 fixed test of max age when receiving posts
4dc284a csoler Sat, 17 Dec 2016 14:15:51 +0100 added auto-login default on ubuntu
-- Retroshare Dev Team <contact@retroshare.net> Tue, 03 Jan 2017 23:00:00 +0100
retroshare06 (0.6.1-1.20161217.4dc284a3~vivid) vivid; urgency=low
f8f040b csoler Fri, 16 Dec 2016 10:03:23 +0100 fixed deadlock due to cross-locking RsGxsNetService and RsGxsGenExchange (reported by sss) f8f040b csoler Fri, 16 Dec 2016 10:03:23 +0100 fixed deadlock due to cross-locking RsGxsNetService and RsGxsGenExchange (reported by sss)
1ef11a2 csoler Thu, 15 Dec 2016 23:21:11 +0100 Merge pull request #599 from G10h4ck/qml_app_chat 1ef11a2 csoler Thu, 15 Dec 2016 23:21:11 +0100 Merge pull request #599 from G10h4ck/qml_app_chat
b857d9a csoler Thu, 15 Dec 2016 23:10:09 +0100 Merge pull request #605 from csoler/v0.6-FileListsOptim b857d9a csoler Thu, 15 Dec 2016 23:10:09 +0100 Merge pull request #605 from csoler/v0.6-FileListsOptim

View File

@ -386,7 +386,7 @@ bool GxsSecurity::validateNxsMsg(const RsNxsMsg& msg, const RsTlvKeySignature& s
std::cerr << std::endl; std::cerr << std::endl;
std::cerr << "RsNxsMsg :"; std::cerr << "RsNxsMsg :";
std::cerr << std::endl; std::cerr << std::endl;
msg.print(std::cerr, 10); const_cast<RsNxsMsg*>(&msg)->print(std::cerr, 10);
std::cerr << std::endl; std::cerr << std::endl;
#endif #endif
@ -788,8 +788,7 @@ bool GxsSecurity::decrypt(uint8_t *& out, uint32_t & outlen, const uint8_t *in,
else else
{ {
#ifdef GXS_SECURITY_DEBUG #ifdef GXS_SECURITY_DEBUG
std::cerr << "GxsSecurity(): Could not generate publish key " << grpId std::cerr << "GxsSecurity(): Could not generate RSA private key " << key.keyId << std::endl;
<< std::endl;
#endif #endif
return false; return false;
} }
@ -1019,7 +1018,7 @@ bool GxsSecurity::validateNxsGrp(const RsNxsGrp& grp, const RsTlvKeySignature& s
std::cerr << std::endl; std::cerr << std::endl;
std::cerr << "RsNxsGrp :"; std::cerr << "RsNxsGrp :";
std::cerr << std::endl; std::cerr << std::endl;
grp.print(std::cerr, 10); const_cast<RsNxsGrp*>(&grp)->print(std::cerr, 10);
std::cerr << std::endl; std::cerr << std::endl;
#endif #endif

View File

@ -758,7 +758,7 @@ int RsGenExchange::createMessage(RsNxsMsg* msg)
} }
} }
int RsGenExchange::validateMsg(RsNxsMsg *msg, const uint32_t& grpFlag, const uint32_t& signFlag, RsTlvSecurityKeySet& grpKeySet) int RsGenExchange::validateMsg(RsNxsMsg *msg, const uint32_t& grpFlag, const uint32_t& /*signFlag*/, RsTlvSecurityKeySet& grpKeySet)
{ {
bool needIdentitySign = false; bool needIdentitySign = false;
bool needPublishSign = false; bool needPublishSign = false;
@ -799,41 +799,52 @@ int RsGenExchange::validateMsg(RsNxsMsg *msg, const uint32_t& grpFlag, const uin
RsGxsMsgMetaData& metaData = *(msg->metaData); RsGxsMsgMetaData& metaData = *(msg->metaData);
if(needPublishSign) if(needPublishSign)
{ {
RsTlvKeySignature sign = metaData.signSet.keySignSet[INDEX_AUTHEN_PUBLISH]; RsTlvKeySignature sign = metaData.signSet.keySignSet[INDEX_AUTHEN_PUBLISH];
std::map<RsGxsId, RsTlvPublicRSAKey>& keys = grpKeySet.public_keys; std::map<RsGxsId, RsTlvPublicRSAKey>& keys = grpKeySet.public_keys;
std::map<RsGxsId, RsTlvPublicRSAKey>::iterator mit = keys.begin(); std::map<RsGxsId, RsTlvPublicRSAKey>::iterator mit = keys.begin();
RsGxsId keyId; RsGxsId keyId;
for(; mit != keys.end() ; ++mit) for(; mit != keys.end() ; ++mit)
{ {
RsTlvPublicRSAKey& key = mit->second; RsTlvPublicRSAKey& key = mit->second;
if(key.keyFlags & RSTLV_KEY_DISTRIB_PUBLIC_deprecated) if(key.keyFlags & RSTLV_KEY_DISTRIB_PUBLIC_deprecated)
{ {
keyId = key.keyId; keyId = key.keyId;
std::cerr << "WARNING: old style publish key with flags " << key.keyFlags << std::endl; std::cerr << "WARNING: old style publish key with flags " << key.keyFlags << std::endl;
std::cerr << " this cannot be fixed, but RS will deal with it." << std::endl; std::cerr << " this cannot be fixed, but RS will deal with it." << std::endl;
break ; break ;
} }
if(key.keyFlags & RSTLV_KEY_DISTRIB_PUBLISH) // we might have the private key, but we still should be able to check the signature if(key.keyFlags & RSTLV_KEY_DISTRIB_PUBLISH) // we might have the private key, but we still should be able to check the signature
{ {
keyId = key.keyId; keyId = key.keyId;
break; break;
} }
} }
if(!keyId.isNull()) if(!keyId.isNull())
{ {
RsTlvPublicRSAKey& key = keys[keyId]; RsTlvPublicRSAKey& key = keys[keyId];
publishValidate &= GxsSecurity::validateNxsMsg(*msg, sign, key); publishValidate &= GxsSecurity::validateNxsMsg(*msg, sign, key);
} }
else else
{ {
publishValidate = false; std::cerr << "(EE) public publish key not found in group that require publish key validation. This should not happen! msgId=" << metaData.mMsgId << ", grpId=" << metaData.mGroupId << std::endl;
} std::cerr << "(EE) public keys available for this group are: " << std::endl;
}
for(std::map<RsGxsId, RsTlvPublicRSAKey>::const_iterator it(grpKeySet.public_keys.begin());it!=grpKeySet.public_keys.end();++it)
std::cerr << "(EE) " << it->first << std::endl;
std::cerr << "(EE) private keys available for this group are: " << std::endl;
for(std::map<RsGxsId, RsTlvPrivateRSAKey>::const_iterator it(grpKeySet.private_keys.begin());it!=grpKeySet.private_keys.end();++it)
std::cerr << "(EE) " << it->first << std::endl;
publishValidate = false;
}
}
else else
{ {
publishValidate = true; publishValidate = true;
@ -888,14 +899,10 @@ int RsGenExchange::validateMsg(RsNxsMsg *msg, const uint32_t& grpFlag, const uin
if(details.mReputation.mOverallReputationLevel == RsReputations::REPUTATION_LOCALLY_NEGATIVE) if(details.mReputation.mOverallReputationLevel == RsReputations::REPUTATION_LOCALLY_NEGATIVE)
{ {
#ifdef GEN_EXCH_DEBUG #ifdef GEN_EXCH_DEBUG
std::cerr << "RsGenExchange::validateMsg(): message from " << metaData.mAuthorId << ", rejected because reputation score (" << details.mReputation.mOverallReputationLevel <<") is below the accepted threshold (" << reputation_threshold << ")" << std::endl; std::cerr << "RsGenExchange::validateMsg(): message from " << metaData.mAuthorId << ", rejected because reputation level (" << details.mReputation.mOverallReputationLevel <<") indicate that you banned this ID." << std::endl;
#endif #endif
idValidate = false ; idValidate = false ;
} }
#ifdef GEN_EXCH_DEBUG
else
std::cerr << "RsGenExchange::validateMsg(): message from " << metaData.mAuthorId << ", accepted. Reputation score (" << details.mReputation.mOverallReputationScore <<") is above accepted threshold (" << reputation_threshold << ")" << std::endl;
#endif
} }
} }
@ -2745,6 +2752,8 @@ void RsGenExchange::processRecvdMessages()
if(mit != grpMetas.end()) if(mit != grpMetas.end())
{ {
grpMeta = mit->second; grpMeta = mit->second;
GxsSecurity::createPublicKeysFromPrivateKeys(grpMeta->keys); // make sure we have the public keys that correspond to the private ones, as it happens. Most of the time this call does nothing.
validateReturn = validateMsg(msg, grpMeta->mGroupFlags, grpMeta->mSignFlags, grpMeta->keys); validateReturn = validateMsg(msg, grpMeta->mGroupFlags, grpMeta->mSignFlags, grpMeta->keys);
#ifdef GEN_EXCH_DEBUG #ifdef GEN_EXCH_DEBUG
@ -2907,7 +2916,7 @@ void RsGenExchange::processRecvdGroups()
if(deserialOk && acceptNewGroup(meta)) if(deserialOk && acceptNewGroup(meta))
{ {
#ifdef GEN_EXCH_DEBUG #ifdef GEN_EXCH_DEBUG
std::cerr << " processing validation for group " << meta->mGroupId << ", attempts number " << gpsi.mAttempts << std::endl; std::cerr << " processing validation for group " << meta->mGroupId << ", original attempt time: " << time(NULL) - gpsi.mFirstTryTS << " seconds ago" << std::endl;
#endif #endif
grp->metaData = meta; grp->metaData = meta;
uint8_t ret = validateGrp(grp); uint8_t ret = validateGrp(grp);
@ -3118,6 +3127,8 @@ bool RsGenExchange::updateValid(RsGxsGrpMetaData& oldGrpMeta, RsNxsGrp& newGrp)
RsTlvKeySignature adminSign = mit->second; RsTlvKeySignature adminSign = mit->second;
GxsSecurity::createPublicKeysFromPrivateKeys(oldGrpMeta.keys); // make sure we have the public keys that correspond to the private ones, as it happens. Most of the time this call does nothing.
std::map<RsGxsId, RsTlvPublicRSAKey>& keys = oldGrpMeta.keys.public_keys; std::map<RsGxsId, RsTlvPublicRSAKey>& keys = oldGrpMeta.keys.public_keys;
std::map<RsGxsId, RsTlvPublicRSAKey>::iterator keyMit = keys.find(RsGxsId(oldGrpMeta.mGroupId)); std::map<RsGxsId, RsTlvPublicRSAKey>::iterator keyMit = keys.find(RsGxsId(oldGrpMeta.mGroupId));

View File

@ -2031,7 +2031,7 @@ void RsGxsNetService::updateServerSyncTS()
if(mGrpServerUpdate.grpUpdateTS < grpMeta->mRecvTS) if(mGrpServerUpdate.grpUpdateTS < grpMeta->mRecvTS)
{ {
#ifdef NXS_NET_DEBUG_0 #ifdef NXS_NET_DEBUG_0
GXSNETDEBUG__G(grpId) << " updated msgUpdateTS to last RecvTS = " << time(NULL) - grpMeta->mRecvTS << " secs ago for group "<< grpId << ". This is probably because an update has been received." << std::endl; GXSNETDEBUG__G(grpMeta->mGroupId) << " updated msgUpdateTS to last RecvTS = " << time(NULL) - grpMeta->mRecvTS << " secs ago for group "<< grpMeta->mGroupId << ". This is probably because an update has been received." << std::endl;
#endif #endif
mGrpServerUpdate.grpUpdateTS = grpMeta->mRecvTS; mGrpServerUpdate.grpUpdateTS = grpMeta->mRecvTS;
change = true; change = true;
@ -4218,24 +4218,29 @@ void RsGxsNetService::handleRecvSyncMessage(RsNxsSyncMsgReqItem *item,bool item_
{ {
RsGxsMsgMetaData* m = *vit; RsGxsMsgMetaData* m = *vit;
RsIdentityDetails details ; // Check reputation
if(!rsIdentity->getIdDetails(m->mAuthorId,details)) if(!m->mAuthorId.isNull())
{
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 RsIdentityDetails details ;
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 if(!rsIdentity->getIdDetails(m->mAuthorId,details))
continue ; {
std::cerr << /* GXSNETDEBUG_PG(item->PeerId(),item->grpId) << */ " not sending grp message ID " << (*vit)->mMsgId << ", because the identity of the author (" << m->mAuthorId << ") 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 // Check publish TS
if(item->createdSinceTS > (*vit)->mPublishTs || (*vit)->mPublishTs + max_send_delay < now) if(item->createdSinceTS > (*vit)->mPublishTs || ((max_send_delay > 0) && (*vit)->mPublishTs + max_send_delay < now))
{ {
#ifdef NXS_NET_DEBUG_0 #ifdef NXS_NET_DEBUG_0
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;
@ -4750,7 +4755,7 @@ void RsGxsNetService::handleRecvPublishKeys(RsNxsGroupPublishKeyItem *item)
#ifdef NXS_NET_DEBUG_3 #ifdef NXS_NET_DEBUG_3
GXSNETDEBUG_PG(item->PeerId(),item->grpId) << " PeerId : " << item->PeerId() << std::endl; GXSNETDEBUG_PG(item->PeerId(),item->grpId) << " PeerId : " << item->PeerId() << std::endl;
GXSNETDEBUG_PG(item->PeerId(),item->grpId) << " GrpId: " << item->grpId << std::endl; GXSNETDEBUG_PG(item->PeerId(),item->grpId) << " GrpId: " << item->grpId << std::endl;
GXSNETDEBUG_PG(item->PeerId(),item->grpId) << " Got key Item: " << item->key.keyId << std::endl; GXSNETDEBUG_PG(item->PeerId(),item->grpId) << " Got key Item: " << item->private_key.keyId << std::endl;
#endif #endif
// Get the meta data for this group Id // Get the meta data for this group Id
@ -4778,7 +4783,7 @@ void RsGxsNetService::handleRecvPublishKeys(RsNxsGroupPublishKeyItem *item)
bool publi = (item->private_key.keyFlags & RSTLV_KEY_DISTRIB_PUBLISH) && (item->private_key.keyFlags & RSTLV_KEY_TYPE_FULL) ; bool publi = (item->private_key.keyFlags & RSTLV_KEY_DISTRIB_PUBLISH) && (item->private_key.keyFlags & RSTLV_KEY_TYPE_FULL) ;
#ifdef NXS_NET_DEBUG_3 #ifdef NXS_NET_DEBUG_3
GXSNETDEBUG_PG(item->PeerId(),item->grpId)<< " Key id = " << item->key.keyId << " admin=" << admin << ", publish=" << publi << " ts=" << item->key.endTS << std::endl; GXSNETDEBUG_PG(item->PeerId(),item->grpId)<< " Key id = " << item->private_key.keyId << " admin=" << admin << ", publish=" << publi << " ts=" << item->private_key.endTS << std::endl;
#endif #endif
if(!(!admin && publi)) if(!(!admin && publi))

View File

@ -19,9 +19,9 @@ namespace GXS_SERV {
/** START privacy **/ /** START privacy **/
static const uint32_t FLAG_PRIVACY_MASK = 0x0000000f; static const uint32_t FLAG_PRIVACY_MASK = 0x0000000f;
static const uint32_t FLAG_PRIVACY_PRIVATE = 0x00000001; // pub key encrypted static const uint32_t FLAG_PRIVACY_PRIVATE = 0x00000001; // pub key encrypted. No-one can read unless he has the key to decrypt the publish key.
static const uint32_t FLAG_PRIVACY_RESTRICTED = 0x00000002; // publish private key needed to publish static const uint32_t FLAG_PRIVACY_RESTRICTED = 0x00000002; // publish private key needed to publish. Typical usage: channels.
static const uint32_t FLAG_PRIVACY_PUBLIC = 0x00000004; // anyone can publish, publish key pair not needed static const uint32_t FLAG_PRIVACY_PUBLIC = 0x00000004; // anyone can publish, publish key pair not needed. Typical usage: forums.
/** END privacy **/ /** END privacy **/
@ -30,11 +30,11 @@ namespace GXS_SERV {
/** START author authentication flags **/ /** START author authentication flags **/
static const uint32_t FLAG_AUTHOR_AUTHENTICATION_MASK = 0x0000ff00; static const uint32_t FLAG_AUTHOR_AUTHENTICATION_MASK = 0x0000ff00;
static const uint32_t FLAG_AUTHOR_AUTHENTICATION_NONE = 0x00000000; static const uint32_t FLAG_AUTHOR_AUTHENTICATION_NONE = 0x00000000;
static const uint32_t FLAG_AUTHOR_AUTHENTICATION_GPG = 0x00000100; static const uint32_t FLAG_AUTHOR_AUTHENTICATION_GPG = 0x00000100; // Anti-spam feature. Allows to ask higher reputation to anonymous IDs
static const uint32_t FLAG_AUTHOR_AUTHENTICATION_REQUIRED = 0x00000200; static const uint32_t FLAG_AUTHOR_AUTHENTICATION_REQUIRED = 0x00000200;
static const uint32_t FLAG_AUTHOR_AUTHENTICATION_IFNOPUBSIGN = 0x00000400; static const uint32_t FLAG_AUTHOR_AUTHENTICATION_IFNOPUBSIGN = 0x00000400;
static const uint32_t FLAG_AUTHOR_AUTHENTICATION_TRACK_MESSAGES = 0x00000800; // not used anymore static const uint32_t FLAG_AUTHOR_AUTHENTICATION_TRACK_MESSAGES = 0x00000800; // not used anymore
static const uint32_t FLAG_AUTHOR_AUTHENTICATION_GPG_KNOWN = 0x00001000; static const uint32_t FLAG_AUTHOR_AUTHENTICATION_GPG_KNOWN = 0x00001000; // Anti-spam feature. Allows to ask higher reputation to unknown IDs and anonymous IDs
static const uint32_t FLAG_GROUP_SIGN_PUBLISH_MASK = 0x000000ff; static const uint32_t FLAG_GROUP_SIGN_PUBLISH_MASK = 0x000000ff;
static const uint32_t FLAG_GROUP_SIGN_PUBLISH_ENCRYPTED = 0x00000001; static const uint32_t FLAG_GROUP_SIGN_PUBLISH_ENCRYPTED = 0x00000001;
@ -45,24 +45,25 @@ namespace GXS_SERV {
/** START msg authentication flags **/ /** START msg authentication flags **/
static const uint8_t MSG_AUTHEN_MASK = 0x0f; static const uint8_t MSG_AUTHEN_MASK = 0x0f;
static const uint8_t MSG_AUTHEN_ROOT_PUBLISH_SIGN = 0x01; static const uint8_t MSG_AUTHEN_ROOT_PUBLISH_SIGN = 0x01; // means: new threads need to be signed by the publish signature of the group. Typical use: posts in channels.
static const uint8_t MSG_AUTHEN_CHILD_PUBLISH_SIGN = 0x02; static const uint8_t MSG_AUTHEN_CHILD_PUBLISH_SIGN = 0x02; // means: all messages need to be signed by the publish signature of the group. Typical use: channels were comments are restricted to the publisher.
static const uint8_t MSG_AUTHEN_ROOT_AUTHOR_SIGN = 0x04; static const uint8_t MSG_AUTHEN_ROOT_AUTHOR_SIGN = 0x04; // means: new threads need to be signed by the author of the message. Typical use: forums, since posts are signed.
static const uint8_t MSG_AUTHEN_CHILD_AUTHOR_SIGN = 0x08; static const uint8_t MSG_AUTHEN_CHILD_AUTHOR_SIGN = 0x08; // means: all messages need to be signed by the author of the message. Typical use: forums since response to posts are signed, and signed comments in channels.
/** END msg authentication flags **/ /** END msg authentication flags **/
/** START group options flag **/ /** START group options flag **/
static const uint8_t GRP_OPTION_AUTHEN_AUTHOR_SIGN = 0x01; static const uint8_t GRP_OPTION_AUTHEN_AUTHOR_SIGN = 0x01; // means: the group options (serialised grp data) needs to be signed by a specific author stored in GroupMeta.mAuthorId
// note that it is always signed by the *admin* (means the creator) of the group. This author signature is just an option here.
/** END group options flag **/ /** END group options flag **/
/** START Subscription Flags. (LOCAL) **/ /** START Subscription Flags. (LOCAL) **/
static const uint32_t GROUP_SUBSCRIBE_ADMIN = 0x01; static const uint32_t GROUP_SUBSCRIBE_ADMIN = 0x01;// means: you have the admin key for this group
static const uint32_t GROUP_SUBSCRIBE_PUBLISH = 0x02; static const uint32_t GROUP_SUBSCRIBE_PUBLISH = 0x02;// means: you have the publish key for thiss group. Typical use: publish key in channels are shared with specific friends.
static const uint32_t GROUP_SUBSCRIBE_SUBSCRIBED = 0x04; static const uint32_t GROUP_SUBSCRIBE_SUBSCRIBED = 0x04;// means: you are subscribed to a group, which makes you a source for this group to your friend nodes.
static const uint32_t GROUP_SUBSCRIBE_NOT_SUBSCRIBED = 0x08; static const uint32_t GROUP_SUBSCRIBE_NOT_SUBSCRIBED = 0x08;
/*! /*!
@ -82,11 +83,11 @@ namespace GXS_SERV {
* NOTE: RsGxsCommentService uses 0x000f0000. * NOTE: RsGxsCommentService uses 0x000f0000.
*/ */
static const uint32_t GXS_MSG_STATUS_GEN_MASK = 0x0000ffff; static const uint32_t GXS_MSG_STATUS_GEN_MASK = 0x0000ffff;
static const uint32_t GXS_MSG_STATUS_UNPROCESSED = 0x00000001; static const uint32_t GXS_MSG_STATUS_UNPROCESSED = 0x00000001; // Flags to store the read/process status of group messages.
static const uint32_t GXS_MSG_STATUS_GUI_UNREAD = 0x00000002; static const uint32_t GXS_MSG_STATUS_GUI_UNREAD = 0x00000002; // The actual meaning may depend on the type of service.
static const uint32_t GXS_MSG_STATUS_GUI_NEW = 0x00000004; static const uint32_t GXS_MSG_STATUS_GUI_NEW = 0x00000004; //
static const uint32_t GXS_MSG_STATUS_KEEP = 0x00000008; static const uint32_t GXS_MSG_STATUS_KEEP = 0x00000008; //
static const uint32_t GXS_MSG_STATUS_DELETE = 0x00000020; static const uint32_t GXS_MSG_STATUS_DELETE = 0x00000020; //
/** END GXS Msg status flags **/ /** END GXS Msg status flags **/

View File

@ -59,7 +59,7 @@ public:
RsGxsGroupId mGroupId; RsGxsGroupId mGroupId;
std::string mGroupName; std::string mGroupName;
uint32_t mGroupFlags; uint32_t mGroupFlags; // Combination of FLAGS_PRIVACY_PRIVATE | FLAGS_PRIVACY_RESTRICTED | FLAGS_PRIVACY_PUBLIC
uint32_t mSignFlags; // Combination of RSGXS_GROUP_SIGN_PUBLISH_MASK & RSGXS_GROUP_SIGN_AUTHOR_MASK. uint32_t mSignFlags; // Combination of RSGXS_GROUP_SIGN_PUBLISH_MASK & RSGXS_GROUP_SIGN_AUTHOR_MASK.
time_t mPublishTs; // Mandatory. time_t mPublishTs; // Mandatory.

View File

@ -159,21 +159,17 @@ RsServiceInfo p3GxsCircles::getServiceInfo()
uint32_t p3GxsCircles::circleAuthenPolicy() uint32_t p3GxsCircles::circleAuthenPolicy()
{ {
uint32_t policy = 0; uint32_t policy = 0;
uint8_t flag = 0; uint8_t flag = 0;
flag = GXS_SERV::MSG_AUTHEN_ROOT_AUTHOR_SIGN | GXS_SERV::MSG_AUTHEN_CHILD_AUTHOR_SIGN;
//flag = GXS_SERV::MSG_AUTHEN_ROOT_PUBLISH_SIGN;
//flag = GXS_SERV::MSG_AUTHEN_CHILD_PUBLISH_SIGN;
//flag = GXS_SERV::MSG_AUTHEN_ROOT_AUTHOR_SIGN;
//flag = GXS_SERV::MSG_AUTHEN_CHILD_AUTHOR_SIGN;
RsGenExchange::setAuthenPolicyFlag(flag, policy, RsGenExchange::PUBLIC_GRP_BITS); RsGenExchange::setAuthenPolicyFlag(flag, policy, RsGenExchange::PUBLIC_GRP_BITS);
flag |= GXS_SERV::MSG_AUTHEN_ROOT_PUBLISH_SIGN | GXS_SERV::MSG_AUTHEN_CHILD_PUBLISH_SIGN;
RsGenExchange::setAuthenPolicyFlag(flag, policy, RsGenExchange::RESTRICTED_GRP_BITS); RsGenExchange::setAuthenPolicyFlag(flag, policy, RsGenExchange::RESTRICTED_GRP_BITS);
RsGenExchange::setAuthenPolicyFlag(flag, policy, RsGenExchange::PRIVATE_GRP_BITS); RsGenExchange::setAuthenPolicyFlag(flag, policy, RsGenExchange::PRIVATE_GRP_BITS);
flag = 0; flag = 0;
//flag = GXS_SERV::GRP_OPTION_AUTHEN_AUTHOR_SIGN;
RsGenExchange::setAuthenPolicyFlag(flag, policy, RsGenExchange::GRP_OPTION_BITS); RsGenExchange::setAuthenPolicyFlag(flag, policy, RsGenExchange::GRP_OPTION_BITS);
return policy; return policy;

View File

@ -1347,13 +1347,13 @@ void Reputation::updateReputation()
for(std::map<RsPeerId,RsReputations::Opinion>::const_iterator it(mOpinions.begin());it!=mOpinions.end();++it) for(std::map<RsPeerId,RsReputations::Opinion>::const_iterator it(mOpinions.begin());it!=mOpinions.end();++it)
{ {
if(it->second == RsReputations::OPINION_NEGATIVE) if( it->second == RsReputations::OPINION_NEGATIVE)
++mFriendsNegative ; ++mFriendsNegative ;
if(it->second == RsReputations::OPINION_POSITIVE) if( it->second == RsReputations::OPINION_POSITIVE)
++mFriendsPositive ; ++mFriendsPositive ;
friend_total += it->second - 1; friend_total += it->second - 1 ;
} }
if(mOpinions.empty()) // includes the case of no friends! if(mOpinions.empty()) // includes the case of no friends!

View File

@ -323,11 +323,13 @@ IdDialog::IdDialog(QWidget *parent) :
ui->idTreeWidget->setColumnWidth(RSID_COL_NICKNAME, 14 * fontWidth); ui->idTreeWidget->setColumnWidth(RSID_COL_NICKNAME, 14 * fontWidth);
ui->idTreeWidget->setColumnWidth(RSID_COL_KEYID, 20 * fontWidth); ui->idTreeWidget->setColumnWidth(RSID_COL_KEYID, 20 * fontWidth);
ui->idTreeWidget->setColumnWidth(RSID_COL_IDTYPE, 18 * fontWidth); ui->idTreeWidget->setColumnWidth(RSID_COL_IDTYPE, 18 * fontWidth);
ui->idTreeWidget->setColumnWidth(RSID_COL_VOTES, 7 * fontWidth); ui->idTreeWidget->setColumnWidth(RSID_COL_VOTES, 2 * fontWidth);
ui->idTreeWidget->setItemDelegateForColumn(RSID_COL_VOTES,new ReputationItemDelegate(RsReputations::ReputationLevel(0xff))) ; ui->idTreeWidget->setItemDelegateForColumn(RSID_COL_VOTES,new ReputationItemDelegate(RsReputations::ReputationLevel(0xff))) ;
//QHeaderView_setSectionResizeMode(ui->idTreeWidget->header(), QHeaderView::ResizeToContents); /* Set header resize modes and initial section sizes */
QHeaderView * idheader = ui->idTreeWidget->header();
QHeaderView_setSectionResizeModeColumn(idheader, RSID_COL_VOTES, QHeaderView::ResizeToContents);
mIdQueue = new TokenQueue(rsIdentity->getTokenService(), this); mIdQueue = new TokenQueue(rsIdentity->getTokenService(), this);
@ -1854,6 +1856,9 @@ void IdDialog::insertIdDetails(uint32_t token)
frep_string = tr("No votes from friends") ; frep_string = tr("No votes from friends") ;
ui->neighborNodesOpinion_TF->setText(frep_string) ; ui->neighborNodesOpinion_TF->setText(frep_string) ;
ui->label_positive->setText(QString::number(info.mFriendsPositiveVotes));
ui->label_negative->setText(QString::number(info.mFriendsNegativeVotes));
switch(info.mOverallReputationLevel) switch(info.mOverallReputationLevel)
{ {

View File

@ -7,7 +7,7 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>1269</width> <width>1269</width>
<height>1040</height> <height>792</height>
</rect> </rect>
</property> </property>
<property name="sizePolicy"> <property name="sizePolicy">
@ -131,7 +131,7 @@
</layout> </layout>
</widget> </widget>
</item> </item>
<item row="1" column="0"> <item row="2" column="0">
<widget class="QSplitter" name="mainSplitter"> <widget class="QSplitter" name="mainSplitter">
<property name="orientation"> <property name="orientation">
<enum>Qt::Horizontal</enum> <enum>Qt::Horizontal</enum>
@ -243,11 +243,18 @@
</column> </column>
<column> <column>
<property name="text"> <property name="text">
<string>Reputation</string> <string/>
</property>
<property name="toolTip">
<string>Votes</string>
</property> </property>
<property name="textAlignment"> <property name="textAlignment">
<set>AlignLeading|AlignVCenter</set> <set>AlignLeading|AlignVCenter</set>
</property> </property>
<property name="icon">
<iconset resource="../icons.qrc">
<normaloff>:/icons/flag-green.png</normaloff>:/icons/flag-green.png</iconset>
</property>
</column> </column>
</widget> </widget>
</item> </item>
@ -318,7 +325,7 @@
<property name="title"> <property name="title">
<string>Identity info</string> <string>Identity info</string>
</property> </property>
<layout class="QGridLayout" name="gridLayout"> <layout class="QGridLayout" name="gridLayout_3">
<item row="0" column="0"> <item row="0" column="0">
<widget class="QLabel" name="label_Nickname"> <widget class="QLabel" name="label_Nickname">
<property name="text"> <property name="text">
@ -336,9 +343,9 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="0" column="2" rowspan="10"> <item row="0" column="2" rowspan="11">
<layout class="QVBoxLayout" name="detailAvatarVLayout"> <layout class="QGridLayout" name="gridLayout">
<item> <item row="0" column="0">
<widget class="QLabel" name="avatarLabel"> <widget class="QLabel" name="avatarLabel">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed"> <sizepolicy hsizetype="Fixed" vsizetype="Fixed">
@ -375,22 +382,104 @@
</property> </property>
</widget> </widget>
</item> </item>
<item> <item row="1" column="0">
<widget class="QPushButton" name="inviteButton"> <widget class="QPushButton" name="inviteButton">
<property name="text"> <property name="text">
<string>Send Invite</string> <string>Send Invite</string>
</property> </property>
</widget> </widget>
</item> </item>
<item> <item row="2" column="0">
<spacer name="avatarVSpacer"> <layout class="QHBoxLayout" name="horizontalLayout_3">
<property name="spacing">
<number>6</number>
</property>
<item>
<widget class="QLabel" name="label_4">
<property name="maximumSize">
<size>
<width>34</width>
<height>34</height>
</size>
</property>
<property name="text">
<string/>
</property>
<property name="pixmap">
<pixmap resource="../icons.qrc">:/icons/png/thumbs-up.png</pixmap>
</property>
<property name="scaledContents">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_positive">
<property name="font">
<font>
<pointsize>16</pointsize>
</font>
</property>
<property name="toolTip">
<string>Positive votes</string>
</property>
<property name="text">
<string>0</string>
</property>
</widget>
</item>
<item>
<widget class="Line" name="line_3">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_5">
<property name="maximumSize">
<size>
<width>34</width>
<height>34</height>
</size>
</property>
<property name="text">
<string/>
</property>
<property name="pixmap">
<pixmap resource="../icons.qrc">:/icons/png/thumbs-down.png</pixmap>
</property>
<property name="scaledContents">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="label_negative">
<property name="font">
<font>
<pointsize>16</pointsize>
</font>
</property>
<property name="toolTip">
<string>Negative votes</string>
</property>
<property name="text">
<string>0</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="3" column="0">
<spacer name="avatarVSpacer_2">
<property name="orientation"> <property name="orientation">
<enum>Qt::Vertical</enum> <enum>Qt::Vertical</enum>
</property> </property>
<property name="sizeHint" stdset="0"> <property name="sizeHint" stdset="0">
<size> <size>
<width>20</width> <width>118</width>
<height>2</height> <height>17</height>
</size> </size>
</property> </property>
</spacer> </spacer>
@ -475,57 +564,10 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="8" column="0"> <item row="7" column="0">
<widget class="QLabel" name="banoption_label"> <widget class="QLabel" name="label">
<property name="text"> <property name="text">
<string>Ban-option:</string> <string>Your opinion:</string>
</property>
</widget>
</item>
<item row="8" column="1">
<widget class="QCheckBox" name="autoBanIdentities_CB">
<property name="text">
<string>Auto-Ban all identities signed by the same node</string>
</property>
</widget>
</item>
<item row="9" column="0">
<widget class="QLabel" name="neighborNodesOpinion_LB">
<property name="text">
<string>Friend votes:</string>
</property>
</widget>
</item>
<item row="9" column="1">
<widget class="QLineEdit" name="neighborNodesOpinion_TF">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Average opinion of neighbor nodes about this identity. Negative is bad,&lt;/p&gt;&lt;p&gt;positive is good. Zero is neutral.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item row="10" column="0">
<widget class="QLabel" name="overallOpinion_LB">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Overall:</string>
</property>
</widget>
</item>
<item row="10" column="1">
<widget class="QLineEdit" name="overallOpinion_TF">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Overall reputation score, accounting for yours and your friends'.&lt;/p&gt;&lt;p&gt;Negative is bad, positive is good. Zero is neutral. If the score is too low,&lt;/p&gt;&lt;p&gt;the identity is flagged as bad, and will be filtered out in forums, chat lobbies,&lt;/p&gt;&lt;p&gt;channels, etc.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="readOnly">
<bool>true</bool>
</property> </property>
</widget> </widget>
</item> </item>
@ -585,10 +627,57 @@ p, li { white-space: pre-wrap; }
</item> </item>
</widget> </widget>
</item> </item>
<item row="7" column="0"> <item row="8" column="0">
<widget class="QLabel" name="label"> <widget class="QLabel" name="banoption_label">
<property name="text"> <property name="text">
<string>Your opinion:</string> <string>Ban-option:</string>
</property>
</widget>
</item>
<item row="8" column="1">
<widget class="QCheckBox" name="autoBanIdentities_CB">
<property name="text">
<string>Auto-Ban all identities signed by the same node</string>
</property>
</widget>
</item>
<item row="9" column="0">
<widget class="QLabel" name="neighborNodesOpinion_LB">
<property name="text">
<string>Friend votes:</string>
</property>
</widget>
</item>
<item row="9" column="1">
<widget class="QLineEdit" name="neighborNodesOpinion_TF">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Average opinion of neighbor nodes about this identity. Negative is bad,&lt;/p&gt;&lt;p&gt;positive is good. Zero is neutral.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
<item row="10" column="0">
<widget class="QLabel" name="overallOpinion_LB">
<property name="font">
<font>
<weight>75</weight>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>Overall:</string>
</property>
</widget>
</item>
<item row="10" column="1">
<widget class="QLineEdit" name="overallOpinion_TF">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Overall reputation score, accounting for yours and your friends'.&lt;/p&gt;&lt;p&gt;Negative is bad, positive is good. Zero is neutral. If the score is too low,&lt;/p&gt;&lt;p&gt;the identity is flagged as bad, and will be filtered out in forums, chat lobbies,&lt;/p&gt;&lt;p&gt;channels, etc.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="readOnly">
<bool>true</bool>
</property> </property>
</widget> </widget>
</item> </item>

View File

@ -160,7 +160,7 @@ static void loadPrivateIdsCallback(GxsIdDetailsType type, const RsIdentityDetail
break; break;
case GXS_ID_DETAILS_TYPE_DONE: case GXS_ID_DETAILS_TYPE_DONE:
GxsIdDetails::getIcons(details, icons); GxsIdDetails::getIcons(details, icons, GxsIdDetails::ICON_TYPE_AVATAR);
break; break;
case GXS_ID_DETAILS_TYPE_BANNED: case GXS_ID_DETAILS_TYPE_BANNED:

View File

@ -51,8 +51,8 @@
#define REPUTATION_LOCALLY_POSITIVE_ICON ":/icons/bullet_green_yellow_star_128.png" #define REPUTATION_LOCALLY_POSITIVE_ICON ":/icons/bullet_green_yellow_star_128.png"
#define REPUTATION_REMOTELY_POSITIVE_ICON ":/icons/bullet_green_128.png" #define REPUTATION_REMOTELY_POSITIVE_ICON ":/icons/bullet_green_128.png"
#define REPUTATION_NEUTRAL_ICON ":/icons/bullet_grey_128.png" #define REPUTATION_NEUTRAL_ICON ":/icons/bullet_grey_128.png"
#define REPUTATION_REMOTELY_NEGATIVE_ICON ":/icons/yellow_biohazard64.png" #define REPUTATION_REMOTELY_NEGATIVE_ICON ":/icons/biohazard_yellow.png"
#define REPUTATION_LOCALLY_NEGATIVE_ICON ":/icons/red_biohazard64.png" #define REPUTATION_LOCALLY_NEGATIVE_ICON ":/icons/biohazard_red.png"
#define REPUTATION_VOID ":/icons/void_128.png" #define REPUTATION_VOID ":/icons/void_128.png"
#define TIMER_INTERVAL 500 #define TIMER_INTERVAL 500
@ -996,18 +996,17 @@ QString nickname ;
QIcon GxsIdDetails::getReputationIcon(RsReputations::ReputationLevel icon_index,uint32_t min_reputation) QIcon GxsIdDetails::getReputationIcon(RsReputations::ReputationLevel icon_index,uint32_t min_reputation)
{ {
if(icon_index >= min_reputation) if( icon_index >= min_reputation ) return QIcon(REPUTATION_VOID) ;
return QIcon(REPUTATION_VOID);
switch(icon_index) switch(icon_index)
{ {
case RsReputations::REPUTATION_LOCALLY_NEGATIVE: return QIcon(REPUTATION_LOCALLY_NEGATIVE_ICON) ; break ; case RsReputations::REPUTATION_LOCALLY_NEGATIVE: return QIcon(REPUTATION_LOCALLY_NEGATIVE_ICON) ; break ;
case RsReputations::REPUTATION_LOCALLY_POSITIVE: return QIcon(REPUTATION_LOCALLY_POSITIVE_ICON) ; break ; case RsReputations::REPUTATION_LOCALLY_POSITIVE: return QIcon(REPUTATION_LOCALLY_POSITIVE_ICON) ; break ;
case RsReputations::REPUTATION_REMOTELY_POSITIVE: return QIcon(REPUTATION_REMOTELY_POSITIVE_ICON) ; break ; case RsReputations::REPUTATION_REMOTELY_POSITIVE: return QIcon(REPUTATION_REMOTELY_POSITIVE_ICON) ; break ;
case RsReputations::REPUTATION_REMOTELY_NEGATIVE: return QIcon(REPUTATION_REMOTELY_NEGATIVE_ICON) ; break ; case RsReputations::REPUTATION_REMOTELY_NEGATIVE: return QIcon(REPUTATION_REMOTELY_NEGATIVE_ICON) ; break ;
case RsReputations::REPUTATION_NEUTRAL: return QIcon(REPUTATION_NEUTRAL_ICON) ; break ; case RsReputations::REPUTATION_NEUTRAL: return QIcon(REPUTATION_NEUTRAL_ICON) ; break ;
default: default:
std::cerr << "Asked for unidentified icon index " << icon_index << std::endl; std::cerr << "Asked for unidentified icon index " << icon_index << std::endl;
return QIcon(); // dont draw anything return QIcon(); // dont draw anything
} }
} }

View File

@ -224,8 +224,11 @@ GxsForumThreadWidget::GxsForumThreadWidget(const RsGxsGroupId &forumId, QWidget
/* Set header resize modes and initial section sizes */ /* Set header resize modes and initial section sizes */
QHeaderView * ttheader = ui->threadTreeWidget->header () ; QHeaderView * ttheader = ui->threadTreeWidget->header () ;
QHeaderView_setSectionResizeModeColumn(ttheader, COLUMN_THREAD_TITLE, QHeaderView::Interactive); QHeaderView_setSectionResizeModeColumn(ttheader, COLUMN_THREAD_TITLE, QHeaderView::Interactive);
QHeaderView_setSectionResizeModeColumn(ttheader, COLUMN_THREAD_DISTRIBUTION, QHeaderView::ResizeToContents);
ttheader->resizeSection (COLUMN_THREAD_DATE, 140); ttheader->resizeSection (COLUMN_THREAD_DATE, 140);
ttheader->resizeSection (COLUMN_THREAD_TITLE, 440); ttheader->resizeSection (COLUMN_THREAD_TITLE, 440);
ttheader->resizeSection (COLUMN_THREAD_DISTRIBUTION, 24);
ttheader->resizeSection (COLUMN_THREAD_AUTHOR, 150); ttheader->resizeSection (COLUMN_THREAD_AUTHOR, 150);
ui->threadTreeWidget->sortItems(COLUMN_THREAD_DATE, Qt::DescendingOrder); ui->threadTreeWidget->sortItems(COLUMN_THREAD_DATE, Qt::DescendingOrder);
@ -1072,18 +1075,18 @@ QTreeWidgetItem *GxsForumThreadWidget::convertMsgToThreadWidget(const RsGxsForum
// Early check for a message that should be hidden because its author // Early check for a message that should be hidden because its author
// is flagged with a bad reputation // is flagged with a bad reputation
RsIdentityDetails iddetails ; RsIdentityDetails iddetails;
RsReputations::ReputationLevel reputation_level = RsReputations::REPUTATION_NEUTRAL ; RsReputations::ReputationLevel reputation_level = RsReputations::REPUTATION_NEUTRAL;
bool redacted = false ; bool redacted = false;
if(rsIdentity->getIdDetails(msg.mMeta.mAuthorId,iddetails)) if( rsIdentity->getIdDetails(msg.mMeta.mAuthorId,iddetails) )
{ {
reputation_level = iddetails.mReputation.mOverallReputationLevel ; reputation_level = iddetails.mReputation.mOverallReputationLevel;
redacted = (reputation_level == RsReputations::REPUTATION_LOCALLY_NEGATIVE) ; redacted = (reputation_level == RsReputations::REPUTATION_LOCALLY_NEGATIVE);
} }
else else
reputation_level = RsReputations::REPUTATION_UNKNOWN ; reputation_level = RsReputations::REPUTATION_UNKNOWN;
GxsIdRSTreeWidgetItem *item = new GxsIdRSTreeWidgetItem(mThreadCompareRole,GxsIdDetails::ICON_TYPE_AVATAR ); GxsIdRSTreeWidgetItem *item = new GxsIdRSTreeWidgetItem(mThreadCompareRole,GxsIdDetails::ICON_TYPE_AVATAR );
item->moveToThread(ui->threadTreeWidget->thread()); item->moveToThread(ui->threadTreeWidget->thread());

View File

@ -240,8 +240,15 @@
</column> </column>
<column> <column>
<property name="text"> <property name="text">
<string/>
</property>
<property name="toolTip">
<string>Distribution</string> <string>Distribution</string>
</property> </property>
<property name="icon">
<iconset resource="../icons.qrc">
<normaloff>:/icons/flag-green.png</normaloff>:/icons/flag-green.png</iconset>
</property>
</column> </column>
<column> <column>
<property name="text"> <property name="text">
@ -556,6 +563,7 @@
</customwidgets> </customwidgets>
<resources> <resources>
<include location="../images.qrc"/> <include location="../images.qrc"/>
<include location="../icons.qrc"/>
</resources> </resources>
<connections/> <connections/>
</ui> </ui>

View File

@ -6,6 +6,8 @@
<file>icons/aol.png</file> <file>icons/aol.png</file>
<file>icons/avatar_128.png</file> <file>icons/avatar_128.png</file>
<file>icons/avatar_grey_128.png</file> <file>icons/avatar_grey_128.png</file>
<file>icons/biohazard_red.png</file>
<file>icons/biohazard_yellow.png</file>
<file>icons/blank_blue_128.png</file> <file>icons/blank_blue_128.png</file>
<file>icons/blank_green_128.png</file> <file>icons/blank_green_128.png</file>
<file>icons/blank_red_128.png</file> <file>icons/blank_red_128.png</file>
@ -23,6 +25,7 @@
<file>icons/chat_red_128.png</file> <file>icons/chat_red_128.png</file>
<file>icons/circles_128.png</file> <file>icons/circles_128.png</file>
<file>icons/circles_new_128.png</file> <file>icons/circles_new_128.png</file>
<file>icons/flag-green.png</file>
<file>icons/friends_128.png</file> <file>icons/friends_128.png</file>
<file>icons/global_switch_off_128.png</file> <file>icons/global_switch_off_128.png</file>
<file>icons/global_switch_on_128.png</file> <file>icons/global_switch_on_128.png</file>
@ -106,7 +109,6 @@
<file>icons/posted_128.png</file> <file>icons/posted_128.png</file>
<file>icons/posted_red_128.png</file> <file>icons/posted_red_128.png</file>
<file>icons/quit_128.png</file> <file>icons/quit_128.png</file>
<file>icons/red_biohazard64.png</file>
<file>icons/search_red_128.png</file> <file>icons/search_red_128.png</file>
<file>icons/security_high_128.png</file> <file>icons/security_high_128.png</file>
<file>icons/security_low_128.png</file> <file>icons/security_low_128.png</file>
@ -222,6 +224,5 @@
<file>icons/warning_yellow_128.png</file> <file>icons/warning_yellow_128.png</file>
<file>icons/yahoo.png</file> <file>icons/yahoo.png</file>
<file>icons/yandex.png</file> <file>icons/yandex.png</file>
<file>icons/yellow_biohazard64.png</file>
</qresource> </qresource>
</RCC> </RCC>

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.9 KiB