mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-01-28 00:07:09 -05:00
Merge pull request #1854 from PhenomRetroShare/Fix_ForumMarkAllAsRead
Fix Forum Mark All As Read.
This commit is contained in:
commit
05e3ab9dcd
@ -1226,13 +1226,17 @@ void RsGxsForumModel::setMsgReadStatus(const QModelIndex& i,bool read_status,boo
|
|||||||
|
|
||||||
void RsGxsForumModel::recursSetMsgReadStatus(ForumModelIndex i,bool read_status,bool with_children)
|
void RsGxsForumModel::recursSetMsgReadStatus(ForumModelIndex i,bool read_status,bool with_children)
|
||||||
{
|
{
|
||||||
if(read_status)
|
int newStatus = (read_status ? mPosts[i].mMsgStatus & ~static_cast<int>(GXS_SERV::GXS_MSG_STATUS_GUI_UNREAD)
|
||||||
mPosts[i].mMsgStatus = 0;
|
: mPosts[i].mMsgStatus | static_cast<int>(GXS_SERV::GXS_MSG_STATUS_GUI_UNREAD));
|
||||||
else
|
bool bChanged = (mPosts[i].mMsgStatus != newStatus);
|
||||||
mPosts[i].mMsgStatus = GXS_SERV::GXS_MSG_STATUS_GUI_UNREAD;
|
mPosts[i].mMsgStatus = newStatus;
|
||||||
|
//Remove Unprocessed and New flags
|
||||||
|
mPosts[i].mMsgStatus &= ~(GXS_SERV::GXS_MSG_STATUS_UNPROCESSED | GXS_SERV::GXS_MSG_STATUS_GUI_NEW);
|
||||||
|
|
||||||
|
if (bChanged)
|
||||||
|
{
|
||||||
|
//Don't recurs post versions as this should be done before, if no change.
|
||||||
uint32_t token;
|
uint32_t token;
|
||||||
|
|
||||||
auto s = getPostVersions(mPosts[i].mMsgId) ;
|
auto s = getPostVersions(mPosts[i].mMsgId) ;
|
||||||
|
|
||||||
if(!s.empty())
|
if(!s.empty())
|
||||||
@ -1243,6 +1247,7 @@ void RsGxsForumModel::recursSetMsgReadStatus(ForumModelIndex i,bool read_status,
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
rsGxsForums->setMessageReadStatus(token,std::make_pair( mForumGroup.mMeta.mGroupId, mPosts[i].mMsgId ), read_status);
|
rsGxsForums->setMessageReadStatus(token,std::make_pair( mForumGroup.mMeta.mGroupId, mPosts[i].mMsgId ), read_status);
|
||||||
|
}
|
||||||
|
|
||||||
if(!with_children)
|
if(!with_children)
|
||||||
return;
|
return;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user