made rsGxsForum provide posts in a hierarchy, to ease the display from JSON API clients, and fixed the unread posts counting

This commit is contained in:
csoler 2023-05-20 22:05:37 +02:00
parent c970e94221
commit f667daba98
3 changed files with 40 additions and 424 deletions

View file

@ -104,11 +104,23 @@ bool GxsForumsDialog::getGroupData(std::list<RsGxsGenericGroupData*>& groupInfo)
bool GxsForumsDialog::getGroupStatistics(const RsGxsGroupId& groupId,GxsGroupStatistic& stat)
{
return rsGxsForums->getForumStatistics(groupId,stat);
RsGxsForumStatistics s;
if(!rsGxsForums->getForumStatistics(groupId,s))
return false;
stat.mGrpId = groupId;
stat.mNumMsgs = s.mNumberOfMessages;
stat.mTotalSizeOfMsgs = 0; // hopefuly unused. Required the loading of the full channel data, so not very convenient.
stat.mNumThreadMsgsNew = s.mNumberOfNewMessages;
stat.mNumThreadMsgsUnread = s.mNumberOfUnreadMessages;
stat.mNumChildMsgsNew = 0;
stat.mNumChildMsgsUnread = 0;
return true;
}
QString GxsForumsDialog::getHelpString() const
{
int H = misc::getFontSizeFactor("HelpButton").height();