mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-07-26 16:05:48 -04:00
fixed setting of author reputation from forum thread menu
This commit is contained in:
parent
3a92124aac
commit
da881e1f5b
2 changed files with 26 additions and 15 deletions
|
@ -472,7 +472,7 @@ void GxsForumThreadWidget::threadListCustomPopupMenu(QPoint /*point*/)
|
||||||
QAction *replyAct = new QAction(QIcon(IMAGE_MESSAGEREPLY), tr("Reply"), &contextMnu);
|
QAction *replyAct = new QAction(QIcon(IMAGE_MESSAGEREPLY), tr("Reply"), &contextMnu);
|
||||||
connect(replyAct, SIGNAL(triggered()), this, SLOT(replytoforummessage()));
|
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()));
|
connect(replyauthorAct, SIGNAL(triggered()), this, SLOT(replytomessage()));
|
||||||
|
|
||||||
QAction *flagaspositiveAct = new QAction(QIcon(IMAGE_POSITIVE_OPINION), tr("Give positive opinion"), &contextMnu);
|
QAction *flagaspositiveAct = new QAction(QIcon(IMAGE_POSITIVE_OPINION), tr("Give positive opinion"), &contextMnu);
|
||||||
|
@ -480,7 +480,7 @@ void GxsForumThreadWidget::threadListCustomPopupMenu(QPoint /*point*/)
|
||||||
flagaspositiveAct->setData(mTokenTypePositiveAuthor) ;
|
flagaspositiveAct->setData(mTokenTypePositiveAuthor) ;
|
||||||
connect(flagaspositiveAct, SIGNAL(triggered()), this, SLOT(flagperson()));
|
connect(flagaspositiveAct, SIGNAL(triggered()), this, SLOT(flagperson()));
|
||||||
|
|
||||||
QAction *flagasneutralAct = new QAction(QIcon(IMAGE_NEUTRAL_OPINION), tr("Give neutral opinion to this author"), &contextMnu);
|
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->setToolTip(tr("Doing this, you trust your friends to decide to forward this message or not.")) ;
|
||||||
flagasneutralAct->setData(mTokenTypeNeutralAuthor) ;
|
flagasneutralAct->setData(mTokenTypeNeutralAuthor) ;
|
||||||
connect(flagasneutralAct, SIGNAL(triggered()), this, SLOT(flagperson()));
|
connect(flagasneutralAct, SIGNAL(triggered()), this, SLOT(flagperson()));
|
||||||
|
@ -512,7 +512,7 @@ void GxsForumThreadWidget::threadListCustomPopupMenu(QPoint /*point*/)
|
||||||
QAction *markMsgAsUnreadChildren = new QAction(QIcon(":/images/message-mail.png"), tr("Mark as unread") + " (" + tr ("with children") + ")", &contextMnu);
|
QAction *markMsgAsUnreadChildren = new QAction(QIcon(":/images/message-mail.png"), tr("Mark as unread") + " (" + tr ("with children") + ")", &contextMnu);
|
||||||
connect(markMsgAsUnreadChildren, SIGNAL(triggered()), this, SLOT(markMsgAsUnreadChildren()));
|
connect(markMsgAsUnreadChildren, SIGNAL(triggered()), this, SLOT(markMsgAsUnreadChildren()));
|
||||||
|
|
||||||
QAction *showinpeopleAct = new QAction(QIcon(":/images/message-mail.png"), tr("Show in people tab"), &contextMnu);
|
QAction *showinpeopleAct = new QAction(QIcon(":/images/message-mail.png"), tr("Show author in people tab"), &contextMnu);
|
||||||
connect(showinpeopleAct, SIGNAL(triggered()), this, SLOT(showInPeopleTab()));
|
connect(showinpeopleAct, SIGNAL(triggered()), this, SLOT(showInPeopleTab()));
|
||||||
|
|
||||||
if (IS_GROUP_SUBSCRIBED(mSubscribeFlags)) {
|
if (IS_GROUP_SUBSCRIBED(mSubscribeFlags)) {
|
||||||
|
@ -573,7 +573,7 @@ void GxsForumThreadWidget::threadListCustomPopupMenu(QPoint /*point*/)
|
||||||
|
|
||||||
contextMnu.addSeparator();
|
contextMnu.addSeparator();
|
||||||
|
|
||||||
QMenu *submenu1 = contextMnu.addMenu(tr("Reputation")) ;
|
QMenu *submenu1 = contextMnu.addMenu(tr("Author's reputation")) ;
|
||||||
submenu1->addAction(flagaspositiveAct);
|
submenu1->addAction(flagaspositiveAct);
|
||||||
submenu1->addAction(flagasneutralAct);
|
submenu1->addAction(flagasneutralAct);
|
||||||
submenu1->addAction(flagasnegativeAct);
|
submenu1->addAction(flagasnegativeAct);
|
||||||
|
@ -2421,7 +2421,7 @@ void GxsForumThreadWidget::loadMsgData_ShowAuthorInPeople(const uint32_t &token)
|
||||||
std::cerr << "GxsForumThreadWidget::loadMsgData_showAuthorInPeople() ERROR Missing Message Data...";
|
std::cerr << "GxsForumThreadWidget::loadMsgData_showAuthorInPeople() ERROR Missing Message Data...";
|
||||||
}
|
}
|
||||||
|
|
||||||
void GxsForumThreadWidget::loadMsgData_BanAuthor(const uint32_t &token)
|
void GxsForumThreadWidget::loadMsgData_SetAuthorOpinion(const uint32_t &token,RsReputations::Opinion opinion)
|
||||||
{
|
{
|
||||||
#ifdef DEBUG_FORUMS
|
#ifdef DEBUG_FORUMS
|
||||||
std::cerr << "GxsForumThreadWidget::loadMsgData_BanAuthor()";
|
std::cerr << "GxsForumThreadWidget::loadMsgData_BanAuthor()";
|
||||||
|
@ -2439,7 +2439,8 @@ void GxsForumThreadWidget::loadMsgData_BanAuthor(const uint32_t &token)
|
||||||
}
|
}
|
||||||
|
|
||||||
std::cerr << " banning author id " << msgs[0].mMeta.mAuthorId << std::endl;
|
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
|
else
|
||||||
{
|
{
|
||||||
|
@ -2490,8 +2491,18 @@ void GxsForumThreadWidget::loadRequest(const TokenQueue *queue, const TokenReque
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (req.mUserType == mTokenTypePositiveAuthor) {
|
||||||
|
loadMsgData_SetAuthorOpinion(req.mToken,RsReputations::OPINION_POSITIVE);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (req.mUserType == mTokenTypeNegativeAuthor) {
|
if (req.mUserType == mTokenTypeNegativeAuthor) {
|
||||||
loadMsgData_BanAuthor(req.mToken);
|
loadMsgData_SetAuthorOpinion(req.mToken,RsReputations::OPINION_NEGATIVE);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (req.mUserType == mTokenTypeNeutralAuthor) {
|
||||||
|
loadMsgData_SetAuthorOpinion(req.mToken,RsReputations::OPINION_NEUTRAL);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -155,7 +155,7 @@ private:
|
||||||
void loadMsgData_ReplyMessage(const uint32_t &token);
|
void loadMsgData_ReplyMessage(const uint32_t &token);
|
||||||
void loadMsgData_ReplyForumMessage(const uint32_t &token);
|
void loadMsgData_ReplyForumMessage(const uint32_t &token);
|
||||||
void loadMsgData_ShowAuthorInPeople(const uint32_t &token);
|
void loadMsgData_ShowAuthorInPeople(const uint32_t &token);
|
||||||
void loadMsgData_BanAuthor(const uint32_t &token);
|
void loadMsgData_SetAuthorOpinion(const uint32_t &token, RsReputations::Opinion opinion);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
RsGxsGroupId mLastForumID;
|
RsGxsGroupId mLastForumID;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue