Fix Commit #77adc82

Fix Missing messages when mark all as read.
This commit is contained in:
Phenom 2017-05-08 14:53:53 +02:00
parent add529ffd3
commit 79bbe0e5bb

View File

@ -1850,16 +1850,20 @@ void GxsForumThreadWidget::setMsgReadStatus(QList<QTreeWidgetItem*> &rows, bool
rsGxsForums->setMessageReadStatus(token, msgPair, read);
// Look if older version exist to mark them too
QMap<RsGxsMessageId,QVector<QPair<time_t,RsGxsMessageId> > >::const_iterator it = mPostVersions.find(mOrigThreadId) ;
QMap<RsGxsMessageId,QVector<QPair<time_t,RsGxsMessageId> > >::const_iterator it = mPostVersions.find(RsGxsMessageId(msgId)) ;
if(it != mPostVersions.end())
{
std::cerr << (*it).size() << " versions found " << std::endl;
for(int i=0;i<(*it).size();++i)
{
msgPair = std::make_pair( groupId(), (*it)[i].second );
RsGxsMessageId found = (*it)[i].second;
if(found != RsGxsMessageId(msgId))
{
msgPair = std::make_pair( groupId(), found );
rsGxsForums->setMessageReadStatus(token, msgPair, read);
}
}
}
/* Add message id to ignore list for the next updateDisplay */
mIgnoredMsgId.push_back(RsGxsMessageId(msgId));