fixed ghost unread forum posts problems by setting read status of all versions of the same post at once. WARNING: this will not remove ghost posts that are already here unless the user reads them again

This commit is contained in:
csoler 2019-01-13 15:19:07 +01:00
parent 957435acc7
commit c04821d91c
No known key found for this signature in database
GPG Key ID: 7BCA522266C0804C

View File

@ -1179,6 +1179,16 @@ void RsGxsForumModel::recursSetMsgReadStatus(ForumModelIndex i,bool read_status,
mPosts[i].mMsgStatus = GXS_SERV::GXS_MSG_STATUS_GUI_UNREAD;
uint32_t token;
auto s = getPostVersions(mPosts[i].mMsgId) ;
if(!s.empty())
for(auto it(s.begin());it!=s.end();++it)
{
rsGxsForums->setMessageReadStatus(token,std::make_pair( mForumGroup.mMeta.mGroupId, it->second ), read_status);
std::cerr << "Setting version " << it->second << " of post " << mPosts[i].mMsgId << " as read." << std::endl;
}
else
rsGxsForums->setMessageReadStatus(token,std::make_pair( mForumGroup.mMeta.mGroupId, mPosts[i].mMsgId ), read_status);
if(!with_children)