mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-12-16 00:53:58 -05:00
prevent editing of pinned posts
This commit is contained in:
parent
d856566c69
commit
1392c7c6fe
1 changed files with 19 additions and 14 deletions
|
|
@ -615,23 +615,28 @@ void GxsForumThreadWidget::threadListCustomPopupMenu(QPoint /*point*/)
|
||||||
QTreeWidgetItem *item = *selectedItems.begin();
|
QTreeWidgetItem *item = *selectedItems.begin();
|
||||||
GxsIdRSTreeWidgetItem *gxsIdItem = dynamic_cast<GxsIdRSTreeWidgetItem*>(item);
|
GxsIdRSTreeWidgetItem *gxsIdItem = dynamic_cast<GxsIdRSTreeWidgetItem*>(item);
|
||||||
|
|
||||||
RsGxsId author_id;
|
bool is_pinned = mForumGroup.mPinnedPosts.ids.find( RsGxsMessageId(item->data(COLUMN_THREAD_MSGID,Qt::DisplayRole).toString().toStdString()) ) != mForumGroup.mPinnedPosts.ids.end();
|
||||||
if(gxsIdItem && gxsIdItem->getId(author_id) && rsIdentity->isOwnId(author_id))
|
|
||||||
contextMnu.addAction(editAct);
|
if(!is_pinned)
|
||||||
else
|
|
||||||
{
|
{
|
||||||
// Go through the list of own ids and see if one of them is a moderator
|
RsGxsId author_id;
|
||||||
// TODO: offer to select which moderator ID to use if multiple IDs fit the conditions of the forum
|
if(gxsIdItem && gxsIdItem->getId(author_id) && rsIdentity->isOwnId(author_id))
|
||||||
|
contextMnu.addAction(editAct);
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// Go through the list of own ids and see if one of them is a moderator
|
||||||
|
// TODO: offer to select which moderator ID to use if multiple IDs fit the conditions of the forum
|
||||||
|
|
||||||
std::list<RsGxsId> own_ids ;
|
std::list<RsGxsId> own_ids ;
|
||||||
rsIdentity->getOwnIds(own_ids) ;
|
rsIdentity->getOwnIds(own_ids) ;
|
||||||
|
|
||||||
for(auto it(own_ids.begin());it!=own_ids.end();++it)
|
for(auto it(own_ids.begin());it!=own_ids.end();++it)
|
||||||
if(mForumGroup.mAdminList.ids.find(*it) != mForumGroup.mAdminList.ids.end())
|
if(mForumGroup.mAdminList.ids.find(*it) != mForumGroup.mAdminList.ids.end())
|
||||||
{
|
{
|
||||||
contextMnu.addAction(editAct);
|
contextMnu.addAction(editAct);
|
||||||
break ;
|
break ;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(IS_GROUP_ADMIN(mSubscribeFlags))
|
if(IS_GROUP_ADMIN(mSubscribeFlags))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue