mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-08-01 10:46:23 -04:00
fixed merging with upstream
This commit is contained in:
commit
c555300c37
28 changed files with 1318 additions and 1131 deletions
|
@ -26,7 +26,6 @@
|
|||
#include "gui/common/UIStateHelper.h"
|
||||
|
||||
#include <retroshare/rspeers.h>
|
||||
#include <retroshare/rsreputations.h>
|
||||
|
||||
// Data Requests.
|
||||
#define IDDETAILSDIALOG_IDDETAILS 1
|
||||
|
@ -261,7 +260,7 @@ void IdDetailsDialog::insertIdDetails(uint32_t token)
|
|||
#endif
|
||||
|
||||
RsReputations::ReputationInfo info ;
|
||||
rsReputations->getReputationInfo(RsGxsId(data.mMeta.mGroupId),info) ;
|
||||
rsReputations->getReputationInfo(RsGxsId(data.mMeta.mGroupId),data.mPgpId,info) ;
|
||||
|
||||
ui->neighborNodesOpinion_TF->setText(QString::number(info.mOverallReputationScore-1.0f));
|
||||
|
||||
|
|
|
@ -41,7 +41,6 @@
|
|||
#include "util/QtVersion.h"
|
||||
|
||||
#include <retroshare/rspeers.h>
|
||||
#include <retroshare/rsreputations.h>
|
||||
#include "retroshare/rsgxsflags.h"
|
||||
#include "retroshare/rsmsgs.h"
|
||||
#include <iostream>
|
||||
|
@ -1360,25 +1359,31 @@ bool IdDialog::fillIdListItem(const RsGxsIdGroup& data, QTreeWidgetItem *&item,
|
|||
if (!item)
|
||||
item = new TreeWidgetItem();
|
||||
|
||||
RsReputations::ReputationInfo info ;
|
||||
rsReputations->getReputationInfo(RsGxsId(data.mMeta.mGroupId),info) ;
|
||||
RsIdentityDetails idd ;
|
||||
rsIdentity->getIdDetails(RsGxsId(data.mMeta.mGroupId),idd) ;
|
||||
|
||||
item->setText(RSID_COL_NICKNAME, QString::fromUtf8(data.mMeta.mGroupName.c_str()).left(RSID_MAXIMUM_NICKNAME_SIZE));
|
||||
item->setText(RSID_COL_KEYID, QString::fromStdString(data.mMeta.mGroupId.toStdString()));
|
||||
|
||||
//time_t now = time(NULL) ;
|
||||
//item->setText(RSID_COL_LASTUSED, getHumanReadableDuration(now - data.mLastUsageTS)) ;
|
||||
if(idd.mReputation.mAssessment == RsReputations::ASSESSMENT_BAD)
|
||||
{
|
||||
item->setForeground(RSID_COL_NICKNAME,QBrush(Qt::red));
|
||||
item->setForeground(RSID_COL_KEYID,QBrush(Qt::red));
|
||||
item->setForeground(RSID_COL_IDTYPE,QBrush(Qt::red));
|
||||
}
|
||||
else
|
||||
{
|
||||
item->setForeground(RSID_COL_NICKNAME,QBrush(Qt::black));
|
||||
item->setForeground(RSID_COL_KEYID,QBrush(Qt::black));
|
||||
item->setForeground(RSID_COL_IDTYPE,QBrush(Qt::black));
|
||||
}
|
||||
|
||||
item->setData(RSID_COL_KEYID, Qt::UserRole,QVariant(item_flags)) ;
|
||||
|
||||
item->setTextAlignment(RSID_COL_VOTES, Qt::AlignRight);
|
||||
item->setData(RSID_COL_VOTES,Qt::DisplayRole, QString::number(info.mOverallReputationScore - 1.0f,'f',3));
|
||||
item->setData(RSID_COL_VOTES,Qt::DisplayRole, QString::number(idd.mReputation.mOverallReputationScore - 1.0f,'f',3));
|
||||
|
||||
if(isOwnId)
|
||||
{
|
||||
RsIdentityDetails idd ;
|
||||
rsIdentity->getIdDetails(RsGxsId(data.mMeta.mGroupId),idd) ;
|
||||
|
||||
QFont font = item->font(RSID_COL_NICKNAME) ;
|
||||
|
||||
font.setBold(true) ;
|
||||
|
@ -1740,12 +1745,12 @@ void IdDialog::insertIdDetails(uint32_t token)
|
|||
#endif
|
||||
|
||||
RsReputations::ReputationInfo info ;
|
||||
rsReputations->getReputationInfo(RsGxsId(data.mMeta.mGroupId),info) ;
|
||||
|
||||
ui->neighborNodesOpinion_TF->setText(QString::number(info.mFriendAverage - 1.0f));
|
||||
rsReputations->getReputationInfo(RsGxsId(data.mMeta.mGroupId),data.mPgpId,info) ;
|
||||
|
||||
ui->overallOpinion_TF->setText(QString::number(info.mOverallReputationScore - 1.0f) +" ("+
|
||||
((info.mAssessment == RsReputations::ASSESSMENT_OK)? tr("OK") : tr("Banned")) +")" ) ;
|
||||
ui->neighborNodesOpinion_TF->setText(QString::number(info.mFriendAverage - 1.0f));
|
||||
|
||||
ui->overallOpinion_TF->setText(QString::number(info.mOverallReputationScore - 1.0f) +" ("+
|
||||
((info.mAssessment == RsReputations::ASSESSMENT_OK)? tr("OK") : tr("Banned")) +")" ) ;
|
||||
|
||||
switch(info.mOwnOpinion)
|
||||
{
|
||||
|
@ -2021,10 +2026,10 @@ void IdDialog::IdListCustomPopupMenu( QPoint )
|
|||
#endif
|
||||
RsGxsId keyId((*it)->text(RSID_COL_KEYID).toStdString());
|
||||
|
||||
RsReputations::ReputationInfo info ;
|
||||
rsReputations->getReputationInfo(keyId,info) ;
|
||||
RsIdentityDetails det ;
|
||||
rsIdentity->getIdDetails(keyId,det) ;
|
||||
|
||||
switch(info.mOwnOpinion)
|
||||
switch(det.mReputation.mOwnOpinion)
|
||||
{
|
||||
case RsReputations::OPINION_NEGATIVE: ++n_negative_reputations ;
|
||||
break ;
|
||||
|
|
|
@ -302,7 +302,13 @@ void GxsGroupDialog::setupDefaults()
|
|||
}
|
||||
}
|
||||
ui.antiSpam_trackMessages->setChecked((bool)(mDefaultsFlags & GXS_GROUP_DEFAULTS_ANTISPAM_TRACK));
|
||||
ui.antiSpam_signedIds->setChecked((bool)(mDefaultsFlags & GXS_GROUP_DEFAULTS_ANTISPAM_FAVOR_PGP));
|
||||
|
||||
if( (mDefaultsFlags & GXS_GROUP_DEFAULTS_ANTISPAM_FAVOR_PGP) && (mDefaultsFlags & GXS_GROUP_DEFAULTS_ANTISPAM_FAVOR_PGP_KNOWN))
|
||||
ui.antiSpam_perms_CB->setCurrentIndex(2) ;
|
||||
else if(mDefaultsFlags & GXS_GROUP_DEFAULTS_ANTISPAM_FAVOR_PGP)
|
||||
ui.antiSpam_perms_CB->setCurrentIndex(1) ;
|
||||
else
|
||||
ui.antiSpam_perms_CB->setCurrentIndex(0) ;
|
||||
|
||||
QString antispam_string ;
|
||||
if(mDefaultsFlags & GXS_GROUP_DEFAULTS_ANTISPAM_TRACK) antispam_string += tr("Message tracking") ;
|
||||
|
@ -623,32 +629,37 @@ void GxsGroupDialog::createGroup()
|
|||
|
||||
uint32_t GxsGroupDialog::getGroupSignFlags()
|
||||
{
|
||||
/* grab from the ui options -> */
|
||||
uint32_t signFlags = 0;
|
||||
if (ui.publish_encrypt->isChecked()) {
|
||||
signFlags |= GXS_SERV::FLAG_GROUP_SIGN_PUBLISH_ENCRYPTED;
|
||||
} else if (ui.publish_required->isChecked()) {
|
||||
signFlags |= GXS_SERV::FLAG_GROUP_SIGN_PUBLISH_ALLSIGNED;
|
||||
} else if (ui.publish_threads->isChecked()) {
|
||||
signFlags |= GXS_SERV::FLAG_GROUP_SIGN_PUBLISH_THREADHEAD;
|
||||
} else { // publish_open (default).
|
||||
signFlags |= GXS_SERV::FLAG_GROUP_SIGN_PUBLISH_NONEREQ;
|
||||
}
|
||||
/* grab from the ui options -> */
|
||||
uint32_t signFlags = 0;
|
||||
if (ui.publish_encrypt->isChecked()) {
|
||||
signFlags |= GXS_SERV::FLAG_GROUP_SIGN_PUBLISH_ENCRYPTED;
|
||||
} else if (ui.publish_required->isChecked()) {
|
||||
signFlags |= GXS_SERV::FLAG_GROUP_SIGN_PUBLISH_ALLSIGNED;
|
||||
} else if (ui.publish_threads->isChecked()) {
|
||||
signFlags |= GXS_SERV::FLAG_GROUP_SIGN_PUBLISH_THREADHEAD;
|
||||
} else { // publish_open (default).
|
||||
signFlags |= GXS_SERV::FLAG_GROUP_SIGN_PUBLISH_NONEREQ;
|
||||
}
|
||||
|
||||
if (ui.personal_required->isChecked())
|
||||
signFlags |= GXS_SERV::FLAG_AUTHOR_AUTHENTICATION_REQUIRED;
|
||||
|
||||
if (ui.personal_ifnopub->isChecked())
|
||||
signFlags |= GXS_SERV::FLAG_AUTHOR_AUTHENTICATION_IFNOPUBSIGN;
|
||||
|
||||
// Author Signature.
|
||||
if (ui.antiSpam_signedIds->isChecked())
|
||||
signFlags |= GXS_SERV::FLAG_AUTHOR_AUTHENTICATION_GPG;
|
||||
|
||||
if (ui.antiSpam_trackMessages->isChecked())
|
||||
signFlags |= GXS_SERV::FLAG_AUTHOR_AUTHENTICATION_TRACK_MESSAGES;
|
||||
|
||||
return signFlags;
|
||||
if (ui.personal_required->isChecked())
|
||||
signFlags |= GXS_SERV::FLAG_AUTHOR_AUTHENTICATION_REQUIRED;
|
||||
|
||||
if (ui.personal_ifnopub->isChecked())
|
||||
signFlags |= GXS_SERV::FLAG_AUTHOR_AUTHENTICATION_IFNOPUBSIGN;
|
||||
|
||||
// Author Signature.
|
||||
switch(ui.antiSpam_perms_CB->currentIndex())
|
||||
{
|
||||
case 0: break ;
|
||||
case 2: signFlags |= GXS_SERV::FLAG_AUTHOR_AUTHENTICATION_GPG_KNOWN; // no break below, since we want *both* flags in this case.
|
||||
case 1: signFlags |= GXS_SERV::FLAG_AUTHOR_AUTHENTICATION_GPG;
|
||||
break ;
|
||||
}
|
||||
|
||||
if (ui.antiSpam_trackMessages->isChecked())
|
||||
signFlags |= GXS_SERV::FLAG_AUTHOR_AUTHENTICATION_TRACK_MESSAGES;
|
||||
|
||||
return signFlags;
|
||||
}
|
||||
|
||||
void GxsGroupDialog::setGroupSignFlags(uint32_t signFlags)
|
||||
|
@ -670,11 +681,19 @@ void GxsGroupDialog::setGroupSignFlags(uint32_t signFlags)
|
|||
ui.personal_ifnopub->setChecked(true);
|
||||
|
||||
ui.antiSpam_trackMessages ->setChecked((bool)(signFlags & GXS_SERV::FLAG_AUTHOR_AUTHENTICATION_TRACK_MESSAGES) );
|
||||
ui.antiSpam_signedIds ->setChecked((bool)(signFlags & GXS_SERV::FLAG_AUTHOR_AUTHENTICATION_GPG) );
|
||||
|
||||
if( (signFlags & GXS_SERV::FLAG_AUTHOR_AUTHENTICATION_GPG_KNOWN) && (signFlags & GXS_SERV::FLAG_AUTHOR_AUTHENTICATION_GPG))
|
||||
ui.antiSpam_perms_CB->setCurrentIndex(2) ;
|
||||
else if(signFlags & GXS_SERV::FLAG_AUTHOR_AUTHENTICATION_GPG)
|
||||
ui.antiSpam_perms_CB->setCurrentIndex(1) ;
|
||||
else
|
||||
ui.antiSpam_perms_CB->setCurrentIndex(0) ;
|
||||
|
||||
QString antispam_string ;
|
||||
if(signFlags & GXS_SERV::FLAG_AUTHOR_AUTHENTICATION_TRACK_MESSAGES) antispam_string += tr("Message tracking") ;
|
||||
if(signFlags & GXS_SERV::FLAG_AUTHOR_AUTHENTICATION_GPG) antispam_string += (antispam_string.isNull()?"":" and ")+tr("PGP signature required") ;
|
||||
if(signFlags & GXS_SERV::FLAG_AUTHOR_AUTHENTICATION_GPG_KNOWN) antispam_string += (antispam_string.isNull()?"":" and ")+tr("PGP signature from known ID required") ;
|
||||
else
|
||||
if(signFlags & GXS_SERV::FLAG_AUTHOR_AUTHENTICATION_GPG) antispam_string += (antispam_string.isNull()?"":" and ")+tr("PGP signature required") ;
|
||||
|
||||
ui.antiSpamValueLabel->setText(antispam_string) ;
|
||||
//ui.antiSpam_trackMessages_2->setChecked((bool)(signFlags & GXS_SERV::FLAG_AUTHOR_AUTHENTICATION_TRACK_MESSAGES) );
|
||||
|
|
|
@ -90,8 +90,9 @@ public:
|
|||
#define GXS_GROUP_DEFAULTS_COMMENTS_YES 0x00001000
|
||||
#define GXS_GROUP_DEFAULTS_COMMENTS_NO 0x00002000
|
||||
|
||||
#define GXS_GROUP_DEFAULTS_ANTISPAM_FAVOR_PGP 0x00100000
|
||||
#define GXS_GROUP_DEFAULTS_ANTISPAM_TRACK 0x00200000
|
||||
#define GXS_GROUP_DEFAULTS_ANTISPAM_FAVOR_PGP 0x00100000
|
||||
#define GXS_GROUP_DEFAULTS_ANTISPAM_TRACK 0x00200000
|
||||
#define GXS_GROUP_DEFAULTS_ANTISPAM_FAVOR_PGP_KNOWN 0x00400000
|
||||
|
||||
/*!
|
||||
* The aim of this dialog is to be convenient to encapsulate group
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -29,7 +29,6 @@
|
|||
#include <math.h>
|
||||
#include "GxsIdDetails.h"
|
||||
#include "retroshare-gui/RsAutoUpdatePage.h"
|
||||
#include "retroshare/rsreputations.h"
|
||||
|
||||
#include <retroshare/rspeers.h>
|
||||
|
||||
|
@ -905,7 +904,7 @@ bool GxsIdDetails::MakeIdDesc(const RsGxsId &id, bool doIcons, QString &str, QLi
|
|||
|
||||
QString GxsIdDetails::getName(const RsIdentityDetails &details)
|
||||
{
|
||||
if(rsReputations->isIdentityBanned(details.mId))
|
||||
if(rsIdentity->isBanned(details.mId))
|
||||
return tr("[Banned]") ;
|
||||
|
||||
QString name = QString::fromUtf8(details.mNickname.c_str()).left(RSID_MAXIMUM_NICKNAME_SIZE);
|
||||
|
@ -924,7 +923,7 @@ QString GxsIdDetails::getComment(const RsIdentityDetails &details)
|
|||
QString comment;
|
||||
QString nickname ;
|
||||
|
||||
bool banned = rsReputations->isIdentityBanned(details.mId) ;
|
||||
bool banned = rsIdentity->isBanned(details.mId) ;
|
||||
|
||||
if(details.mNickname.empty())
|
||||
nickname = tr("[Unknown]") ;
|
||||
|
@ -963,7 +962,7 @@ void GxsIdDetails::getIcons(const RsIdentityDetails &details, QList<QIcon> &icon
|
|||
{
|
||||
QPixmap pix ;
|
||||
|
||||
if(rsReputations->isIdentityBanned(details.mId))
|
||||
if(rsIdentity->isBanned(details.mId))
|
||||
{
|
||||
icons.clear() ;
|
||||
icons.push_back(QIcon(IMAGE_BANNED)) ;
|
||||
|
|
|
@ -25,7 +25,6 @@
|
|||
#include "GxsIdTreeWidgetItem.h"
|
||||
#include "GxsIdDetails.h"
|
||||
#include "util/HandleRichText.h"
|
||||
#include "retroshare/rsreputations.h"
|
||||
|
||||
#define BANNED_IMAGE ":/icons/yellow_biohazard64.png"
|
||||
|
||||
|
@ -117,14 +116,14 @@ void GxsIdRSTreeWidgetItem::setId(const RsGxsId &id, int column, bool retryWhenF
|
|||
|
||||
void GxsIdRSTreeWidgetItem::updateBannedState()
|
||||
{
|
||||
if(mBannedState != rsReputations->isIdentityBanned(mId))
|
||||
if(mBannedState != rsIdentity->isBanned(mId))
|
||||
forceUpdate() ;
|
||||
}
|
||||
|
||||
void GxsIdRSTreeWidgetItem::forceUpdate()
|
||||
{
|
||||
mIdFound = false;
|
||||
mBannedState = rsReputations->isIdentityBanned(mId) ;
|
||||
mBannedState = rsIdentity->isBanned(mId) ;
|
||||
|
||||
startProcess();
|
||||
}
|
||||
|
@ -170,7 +169,7 @@ QVariant GxsIdRSTreeWidgetItem::data(int column, int role) const
|
|||
|
||||
if(mId.isNull())
|
||||
return RSTreeWidgetItem::data(column, role);
|
||||
else if(rsReputations->isIdentityBanned(mId))
|
||||
else if(rsIdentity->isBanned(mId))
|
||||
pix = QImage(BANNED_IMAGE) ;
|
||||
else if (mAvatar.mSize == 0 || !pix.loadFromData(mAvatar.mData, mAvatar.mSize, "PNG"))
|
||||
pix = GxsIdDetails::makeDefaultIcon(mId);
|
||||
|
|
|
@ -212,7 +212,7 @@ void CreateGxsForumMsg::loadFormInformation()
|
|||
|
||||
//std::cerr << "CreateGxsForumMsg::loadMsgInformation() using signFlags=" << std::hex << mForumMeta.mSignFlags << std::dec << std::endl;
|
||||
|
||||
if(mForumMeta.mSignFlags & GXS_SERV::FLAG_AUTHOR_AUTHENTICATION_GPG)
|
||||
if( (mForumMeta.mSignFlags & GXS_SERV::FLAG_AUTHOR_AUTHENTICATION_GPG) || (mForumMeta.mSignFlags & GXS_SERV::FLAG_AUTHOR_AUTHENTICATION_GPG_KNOWN))
|
||||
ui.idChooser->setFlags(IDCHOOSER_ID_REQUIRED | IDCHOOSER_NON_ANONYMOUS) ;
|
||||
else
|
||||
ui.idChooser->setFlags(IDCHOOSER_ID_REQUIRED) ;
|
||||
|
|
|
@ -44,7 +44,6 @@
|
|||
|
||||
#include <retroshare/rsgxsforums.h>
|
||||
#include <retroshare/rsgrouter.h>
|
||||
#include <retroshare/rsreputations.h>
|
||||
#include <retroshare/rspeers.h>
|
||||
// These should be in retroshare/ folder.
|
||||
#include "retroshare/rsgxsflags.h"
|
||||
|
@ -791,7 +790,8 @@ void GxsForumThreadWidget::insertGroupData()
|
|||
tw->ui->forumName->setText(QString::fromUtf8(group.mMeta.mGroupName.c_str()));
|
||||
|
||||
QString anti_spam_features1 ;
|
||||
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 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");
|
||||
|
||||
QString anti_spam_features2 ;
|
||||
if(IS_GROUP_MESSAGE_TRACKING(tw->mSignFlags)) anti_spam_features2 = tr("Message routing info kept for 10 days");
|
||||
|
@ -996,7 +996,7 @@ QTreeWidgetItem *GxsForumThreadWidget::convertMsgToThreadWidget(const RsGxsForum
|
|||
// is flagged with a bad reputation
|
||||
|
||||
|
||||
bool redacted = rsReputations->isIdentityBanned(msg.mMeta.mAuthorId) ;
|
||||
bool redacted = rsIdentity->isBanned(msg.mMeta.mAuthorId) ;
|
||||
|
||||
GxsIdRSTreeWidgetItem *item = new GxsIdRSTreeWidgetItem(mThreadCompareRole,GxsIdDetails::ICON_TYPE_ALL || (redacted?(GxsIdDetails::ICON_TYPE_REDACTED):0));
|
||||
item->moveToThread(ui->threadTreeWidget->thread());
|
||||
|
@ -1419,7 +1419,7 @@ void GxsForumThreadWidget::insertMessageData(const RsGxsForumMsg &msg)
|
|||
return;
|
||||
}
|
||||
|
||||
bool redacted = rsReputations->isIdentityBanned(msg.mMeta.mAuthorId) ;
|
||||
bool redacted = rsIdentity->isBanned(msg.mMeta.mAuthorId) ;
|
||||
|
||||
mStateHelper->setActive(mTokenTypeMessageData, true);
|
||||
|
||||
|
|
|
@ -14,6 +14,13 @@ DEFINES += TARGET=\\\"$TARGET\\\"
|
|||
#CONFIG += debug
|
||||
#DEFINES *= SIGFPE_DEBUG
|
||||
|
||||
profiling {
|
||||
QMAKE_CXXFLAGS -= -fomit-frame-pointer
|
||||
QMAKE_CXXFLAGS *= -pg -g -fno-omit-frame-pointer
|
||||
QMAKE_LFLAGS *= -pg
|
||||
}
|
||||
|
||||
|
||||
#QMAKE_CFLAGS += -fmudflap
|
||||
#LIBS *= /usr/lib/gcc/x86_64-linux-gnu/4.4/libmudflap.a /usr/lib/gcc/x86_64-linux-gnu/4.4/libmudflapth.a
|
||||
|
||||
|
@ -69,7 +76,7 @@ linux-* {
|
|||
|
||||
PKGCONFIG *= x11 xscrnsaver
|
||||
|
||||
LIBS *= -rdynamic
|
||||
LIBS *= -rdynamic
|
||||
DEFINES *= HAVE_XSS # for idle time, libx screensaver extensions
|
||||
DEFINES *= HAS_GNOME_KEYRING
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue