Merge remote-tracking branch 'upstream/master' into v0.6-TokenSystem

This commit is contained in:
csoler 2022-08-16 21:47:39 +02:00
commit b784b6a3e8
2 changed files with 10 additions and 8 deletions

View File

@ -411,7 +411,7 @@ void GxsForumMsgItem::doExpand(bool open)
ui->parentFrame->show(); ui->parentFrame->show();
} }
setAsRead(); setAsRead(true);
} }
else else
{ {
@ -459,7 +459,7 @@ void GxsForumMsgItem::readAndClearItem()
std::cerr << std::endl; std::cerr << std::endl;
#endif #endif
setAsRead(); setAsRead(false);
removeItem(); removeItem();
} }
@ -473,7 +473,7 @@ void GxsForumMsgItem::unsubscribeForum()
unsubscribe(); unsubscribe();
} }
void GxsForumMsgItem::setAsRead() void GxsForumMsgItem::setAsRead(bool doUpdate)
{ {
if (mInFill) { if (mInFill) {
return; return;
@ -481,14 +481,16 @@ void GxsForumMsgItem::setAsRead()
mCloseOnRead = false; mCloseOnRead = false;
RsThread::async( [this]() { RsThread::async( [this, doUpdate]() {
RsGxsGrpMsgIdPair msgPair = std::make_pair(groupId(), messageId()); RsGxsGrpMsgIdPair msgPair = std::make_pair(groupId(), messageId());
rsGxsForums->markRead(msgPair, true); rsGxsForums->markRead(msgPair, true);
RsQThreadUtils::postToObject( [this]() { if (doUpdate) {
setReadStatus(false, true); RsQThreadUtils::postToObject( [this]() {
} ); setReadStatus(false, true);
} );
}
}); });
} }

View File

@ -82,7 +82,7 @@ private:
void fillParentMessage(); void fillParentMessage();
void fillExpandFrame(); void fillExpandFrame();
void setReadStatus(bool isNew, bool isUnread); void setReadStatus(bool isNew, bool isUnread);
void setAsRead(); void setAsRead(bool doUpdate);
private: private:
bool mInFill; bool mInFill;