mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-12-24 23:19:29 -05:00
added missing code for marking all msgs as read/unread
This commit is contained in:
parent
ff0836929d
commit
819035472d
@ -658,7 +658,13 @@ QIcon PostedListWidgetWithModel::groupIcon()
|
||||
|
||||
void PostedListWidgetWithModel::setAllMessagesReadDo(bool read, uint32_t &token)
|
||||
{
|
||||
std::cerr << __PRETTY_FUNCTION__ << ": not implemented" << std::endl;
|
||||
if (groupId().isNull() || !IS_GROUP_SUBSCRIBED(mGroup.mMeta.mSubscribeFlags))
|
||||
return;
|
||||
|
||||
QModelIndex src_index;
|
||||
|
||||
mPostedPostsModel->setAllMsgReadStatus(read);
|
||||
|
||||
}
|
||||
|
||||
void PostedListWidgetWithModel::openComments(const RsGxsMessageId& msgId)
|
||||
|
@ -715,6 +715,23 @@ void RsPostedPostsModel::createPostsArray(std::vector<RsPostedPost>& posts)
|
||||
}
|
||||
}
|
||||
|
||||
void RsPostedPostsModel::setAllMsgReadStatus(bool read)
|
||||
{
|
||||
// make a temporary listof pairs
|
||||
|
||||
std::list<RsGxsGrpMsgIdPair> pairs;
|
||||
|
||||
for(uint32_t i=0;i<mPosts.size();++i)
|
||||
pairs.push_back(RsGxsGrpMsgIdPair(mPosts[i].mMeta.mGroupId,mPosts[i].mMeta.mMsgId));
|
||||
|
||||
RsThread::async([read,pairs]()
|
||||
{
|
||||
// Call blocking API
|
||||
|
||||
for(auto& p:pairs)
|
||||
rsPosted->setPostReadStatus(p,read);
|
||||
} );
|
||||
}
|
||||
void RsPostedPostsModel::setMsgReadStatus(const QModelIndex& i,bool read_status)
|
||||
{
|
||||
if(!i.isValid())
|
||||
|
@ -154,6 +154,7 @@ public:
|
||||
void setTextColorMissing (QColor color) { mTextColorMissing = color;}
|
||||
#endif
|
||||
|
||||
void setAllMsgReadStatus(bool read);
|
||||
void setMsgReadStatus(const QModelIndex &i, bool read_status);
|
||||
void setFilter(const QStringList &strings, uint32_t &count) ;
|
||||
void setSortingStrategy(SortingStrategy s);
|
||||
|
Loading…
Reference in New Issue
Block a user