mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-07-20 13:19:07 -04:00
disallow to ban your own identity in forums, and make opinions show up as a function ofwhat the ID opinion already is
This commit is contained in:
parent
17cf6607f8
commit
df94de9142
6 changed files with 63 additions and 12 deletions
|
@ -93,10 +93,10 @@ void GxsIdRSTreeWidgetItem::setId(const RsGxsId &id, int column, bool retryWhenF
|
|||
//std::cerr << " GxsIdRSTreeWidgetItem::setId(" << id << "," << column << ")";
|
||||
//std::cerr << std::endl;
|
||||
|
||||
if (mIdFound) {
|
||||
if (mColumn == column && mId == id) {
|
||||
if (mIdFound)
|
||||
{
|
||||
if (mColumn == column && mId == id && (mBannedState == rsReputations->isIdentityBanned(mId)))
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
mIdFound = false;
|
||||
|
@ -110,14 +110,14 @@ void GxsIdRSTreeWidgetItem::setId(const RsGxsId &id, int column, bool retryWhenF
|
|||
|
||||
void GxsIdRSTreeWidgetItem::updateBannedState()
|
||||
{
|
||||
if(mBannedState != (rsReputations->overallReputationLevel(mId) == RsReputations::REPUTATION_LOCALLY_NEGATIVE))
|
||||
if(mBannedState != rsReputations->isIdentityBanned(mId))
|
||||
forceUpdate() ;
|
||||
}
|
||||
|
||||
void GxsIdRSTreeWidgetItem::forceUpdate()
|
||||
{
|
||||
mIdFound = false;
|
||||
mBannedState = (rsReputations->overallReputationLevel(mId) == RsReputations::REPUTATION_LOCALLY_NEGATIVE);
|
||||
mBannedState = (rsReputations->isIdentityBanned(mId));
|
||||
|
||||
startProcess();
|
||||
}
|
||||
|
|
|
@ -67,6 +67,7 @@ private:
|
|||
bool mIdFound;
|
||||
bool mBannedState ;
|
||||
bool mRetryWhenFailed;
|
||||
RsReputations::ReputationLevel mReputationLevel ;
|
||||
uint32_t mIconTypeMask;
|
||||
RsGxsImage mAvatar;
|
||||
};
|
||||
|
|
|
@ -574,15 +574,40 @@ void GxsForumThreadWidget::threadListCustomPopupMenu(QPoint /*point*/)
|
|||
contextMnu.addAction(expandAll);
|
||||
contextMnu.addAction(collapseAll);
|
||||
|
||||
contextMnu.addSeparator();
|
||||
QList<QTreeWidgetItem*> selectedItems = ui->threadTreeWidget->selectedItems();
|
||||
|
||||
QMenu *submenu1 = contextMnu.addMenu(tr("Author's reputation")) ;
|
||||
submenu1->addAction(flagaspositiveAct);
|
||||
submenu1->addAction(flagasneutralAct);
|
||||
submenu1->addAction(flagasnegativeAct);
|
||||
contextMnu.addAction(showinpeopleAct);
|
||||
if(selectedItems.size() == 1)
|
||||
{
|
||||
QTreeWidgetItem *item = *selectedItems.begin();
|
||||
GxsIdRSTreeWidgetItem *gxsIdItem = dynamic_cast<GxsIdRSTreeWidgetItem*>(item);
|
||||
|
||||
contextMnu.addAction(replyauthorAct);
|
||||
RsGxsId author_id;
|
||||
if(gxsIdItem && gxsIdItem->getId(author_id))
|
||||
{
|
||||
std::cerr << "Author is: " << author_id << std::endl;
|
||||
|
||||
contextMnu.addSeparator();
|
||||
|
||||
RsReputations::Opinion op ;
|
||||
|
||||
if(!rsIdentity->isOwnId(author_id) && rsReputations->getOwnOpinion(author_id,op))
|
||||
{
|
||||
QMenu *submenu1 = contextMnu.addMenu(tr("Author's reputation")) ;
|
||||
|
||||
if(op != RsReputations::OPINION_POSITIVE)
|
||||
submenu1->addAction(flagaspositiveAct);
|
||||
|
||||
if(op != RsReputations::OPINION_NEUTRAL)
|
||||
submenu1->addAction(flagasneutralAct);
|
||||
|
||||
if(op != RsReputations::OPINION_NEGATIVE)
|
||||
submenu1->addAction(flagasnegativeAct);
|
||||
}
|
||||
|
||||
contextMnu.addAction(showinpeopleAct);
|
||||
contextMnu.addAction(replyauthorAct);
|
||||
}
|
||||
}
|
||||
|
||||
contextMnu.exec(QCursor::pos());
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue