mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-12-14 16:18:48 -05:00
added missing code for marking all msgs as read/unread
This commit is contained in:
parent
ff0836929d
commit
819035472d
3 changed files with 25 additions and 1 deletions
|
|
@ -658,7 +658,13 @@ QIcon PostedListWidgetWithModel::groupIcon()
|
||||||
|
|
||||||
void PostedListWidgetWithModel::setAllMessagesReadDo(bool read, uint32_t &token)
|
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)
|
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)
|
void RsPostedPostsModel::setMsgReadStatus(const QModelIndex& i,bool read_status)
|
||||||
{
|
{
|
||||||
if(!i.isValid())
|
if(!i.isValid())
|
||||||
|
|
|
||||||
|
|
@ -154,6 +154,7 @@ public:
|
||||||
void setTextColorMissing (QColor color) { mTextColorMissing = color;}
|
void setTextColorMissing (QColor color) { mTextColorMissing = color;}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
void setAllMsgReadStatus(bool read);
|
||||||
void setMsgReadStatus(const QModelIndex &i, bool read_status);
|
void setMsgReadStatus(const QModelIndex &i, bool read_status);
|
||||||
void setFilter(const QStringList &strings, uint32_t &count) ;
|
void setFilter(const QStringList &strings, uint32_t &count) ;
|
||||||
void setSortingStrategy(SortingStrategy s);
|
void setSortingStrategy(SortingStrategy s);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue