moved update of comment count to libretroshare

This commit is contained in:
csoler 2023-05-17 17:18:47 +02:00
parent e25d8e50fc
commit c970e94221
2 changed files with 7 additions and 63 deletions

View file

@ -821,19 +821,6 @@ void GxsChannelPostsWidgetWithModel::handleEvent_main_thread(std::shared_ptr<con
return;
}
// Need to call this in order to get the actual comment count. The previous call only retrieves the message, since we supplied the message ID.
// another way to go would be to save the comment ids of the existing message and re-insert them before calling getChannelContent.
if(!rsGxsChannels->getChannelComments(grp_id,{ msg_id },comments))
{
RsErr() << " failed to retrieve message comment data for channel/msg " << grp_id << "/" << msg_id ;
return;
}
// Normally, there's a single post in the "post" array. The function below takes a full array of posts however.
RsGxsChannelPostsModel::computeCommentCounts(posts,comments);
// 2 - update the model in the UI thread.
RsQThreadUtils::postToObject( [post=posts[0],this]()