enabled ID tracking forums. Fixed thresholds for anti-spam forums. Changed computation of reputation scored

This commit is contained in:
csoler 2015-10-26 23:38:10 -04:00
parent b009c1135f
commit c7d0e4cb35
14 changed files with 130 additions and 55 deletions

View file

@ -552,7 +552,7 @@
<item>
<widget class="QCheckBox" name="antispam_favorSignedIds">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;This makes the media increase the reputaiton threshold to 0.2,&lt;/p&gt;&lt;p&gt;allowing PGP-linked ids to pass through. Anonymous ids however&lt;/p&gt;&lt;p&gt;can also post, if their local reputation score is above that threshold. &lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;This makes the media increase the reputation threshold to 0.4 for anonymous ids,&lt;/p&gt;&lt;p&gt;while keeping it to 0.0 for PGP-linked ids. Therefore, anonymous ids can still post, if their local reputation &lt;/p&gt;&lt;p&gt;score is above that threshold.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Favor PGP-signed ids</string>
@ -562,7 +562,7 @@
<item>
<widget class="QRadioButton" name="antispam_keepTrackOfPosts">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p align=&quot;justify&quot;&gt;This feature allows Retroshare to locally keep a record of who&lt;/p&gt;&lt;p align=&quot;justify&quot;&gt;forwarded each message to you, for 10 days. Although useless (and already&lt;/p&gt;&lt;p align=&quot;justify&quot;&gt;available whatsoever) this information can be used by a group&lt;/p&gt;&lt;p align=&quot;justify&quot;&gt;of collaborative friends to locate the source of spams. To be used with care,&lt;/p&gt;&lt;p align=&quot;justify&quot;&gt;since it significantly decreases the anonymity of message posts.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p align=&quot;justify&quot;&gt;This feature allows Retroshare to locally keep a record of who&lt;/p&gt;&lt;p align=&quot;justify&quot;&gt;forwarded each message to you, for the last 10 days. Although useless if alone (and already&lt;/p&gt;&lt;p align=&quot;justify&quot;&gt;available whatsoever) this information can be used by a group&lt;/p&gt;&lt;p align=&quot;justify&quot;&gt;of collaborative friends to easily locate the source of spams. To be used with care,&lt;/p&gt;&lt;p align=&quot;justify&quot;&gt;since it significantly decreases the anonymity of message posts.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Keep track of posts</string>

View file

@ -41,6 +41,7 @@
#include "util/QtVersion.h"
#include <retroshare/rsgxsforums.h>
#include <retroshare/rsgrouter.h>
#include <retroshare/rsreputations.h>
#include <retroshare/rspeers.h>
// These should be in retroshare/ folder.
@ -747,13 +748,23 @@ void GxsForumThreadWidget::insertGroupData()
tw->mSignFlags = group.mMeta.mSignFlags;
tw->ui->forumName->setText(QString::fromUtf8(group.mMeta.mGroupName.c_str()));
QString anon_allowed_str = (IS_GROUP_PGP_AUTHED(tw->mSignFlags))?tr("No"):tr("Yes") ;
QString anti_spam_features1 ;
if(IS_GROUP_PGP_AUTHED(tw->mSignFlags)) anti_spam_features1 = tr("Anonymous IDs reputation threshold set to 0.4");
QString anti_spam_features2 ;
if(IS_GROUP_MESSAGE_TRACKING(tw->mSignFlags)) anti_spam_features2 = tr("Message routing info kept for 10 days");
tw->mForumDescription = QString("<b>%1: \t</b>%2<br/>").arg(tr("Forum name"), QString::fromUtf8( group.mMeta.mGroupName.c_str()));
tw->mForumDescription += QString("<b>%1: \t</b>%2<br/>").arg(tr("Subscribers")).arg(group.mMeta.mPop);
tw->mForumDescription += QString("<b>%1: \t</b>%2<br/>").arg(tr("Posts (at neighbor nodes)")).arg(group.mMeta.mVisibleMsgCount);
tw->mForumDescription += QString("<b>%1: \t</b>%2<br/>").arg(tr("Author"), author);
tw->mForumDescription += QString("<b>%1: \t</b>%2<br/>").arg(tr("Anonymous post allowed")).arg(anon_allowed_str);
if(!anti_spam_features1.isNull())
tw->mForumDescription += QString("<b>%1: \t</b>%2<br/>").arg(tr("Anti-spam")).arg(anti_spam_features1);
if(!anti_spam_features2.isNull())
tw->mForumDescription += QString("<b>%1: \t</b>%2<br/>").arg(tr("Anti-spam")).arg(anti_spam_features2);
tw->mForumDescription += QString("<b>%1: </b><br/><br/>%2").arg(tr("Description"), QString::fromUtf8(group.mDescription.c_str()));
tw->ui->subscribeToolButton->setSubscribed(IS_GROUP_SUBSCRIBED(tw->mSubscribeFlags));
@ -942,8 +953,13 @@ QTreeWidgetItem *GxsForumThreadWidget::convertMsgToThreadWidget(const RsGxsForum
item->setData(COLUMN_THREAD_DATA, ROLE_THREAD_AUTHOR, QString::fromStdString(msg.mMeta.mAuthorId.toStdString()));
// Show info about who passed on this message.
if( (mForumGroup.mMeta.mSignFlags & GXS_SERV::FLAG_AUTHOR_AUTHENTICATION_TRACK_MESSAGES) && !msg.mMeta.mProviderId.isNull() )
item->setToolTip(COLUMN_THREAD_TITLE,tr("This message was obtained from %1").arg(QString::fromStdString(msg.mMeta.mProviderId.toStdString())));
if(mForumGroup.mMeta.mSignFlags & GXS_SERV::FLAG_AUTHOR_AUTHENTICATION_TRACK_MESSAGES)
{
RsPeerId providerId ;
if(rsGRouter->getTrackingInfo(msg.mMeta.mMsgId,providerId) && !providerId.isNull() )
item->setToolTip(COLUMN_THREAD_TITLE,tr("This message was obtained from %1").arg(QString::fromUtf8(rsPeers->getPeerName(providerId).c_str())));
}
//#TODO
#if 0
text = QString::fromUtf8(authorName.c_str());