using orange color for unread comment bubble in channel post widget, and fixed the color update when new comment arrives

This commit is contained in:
csoler 2023-03-29 20:46:41 +02:00
parent 48c959c858
commit cc93a6da1a
3 changed files with 51 additions and 27 deletions

View file

@ -801,6 +801,16 @@ void RsGxsChannelPostsModel::setAllMsgReadStatus(bool read_status)
emit dataChanged(createIndex(0,0,(void*)NULL), createIndex(rowCount()-1,mColumns-1,(void*)NULL));
}
void RsGxsChannelPostsModel::updatePostWithNewComment(const RsGxsMessageId& msg_id)
{
for(uint32_t i=0;i<mPosts.size();++i)
if(mPosts[i].mMeta.mMsgId == msg_id)
{
++mPosts[i].mUnreadCommentCount;
emit dataChanged(createIndex(0,0,(void*)NULL), createIndex(rowCount()-1,mColumns-1,(void*)NULL)); // update everything because we don't know the index.
break;
}
}
void RsGxsChannelPostsModel::setMsgReadStatus(const QModelIndex& i,bool read_status)
{
if(!i.isValid())
@ -824,6 +834,8 @@ void RsGxsChannelPostsModel::setMsgReadStatus(const QModelIndex& i,bool read_sta
else
mPosts[mFilteredPosts[entry]].mMeta.mMsgStatus |= GXS_SERV::GXS_MSG_STATUS_GUI_UNREAD;
mPosts[mFilteredPosts[entry]].mUnreadCommentCount = 0;
emit dataChanged(i,i);
}