mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-06-29 00:27:27 -04:00
Fix Channel Post Comments Number
This commit is contained in:
parent
738029f96a
commit
e8b8119174
4 changed files with 40 additions and 3 deletions
|
@ -333,6 +333,19 @@ public:
|
||||||
std::vector<RsGxsChannelPost>& posts,
|
std::vector<RsGxsChannelPost>& posts,
|
||||||
std::vector<RsGxsComment>& comments ) = 0;
|
std::vector<RsGxsComment>& comments ) = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Get channel comments corresponding to the given IDs.
|
||||||
|
* If the set is empty, nothing is returned.
|
||||||
|
* @jsonapi{development}
|
||||||
|
* @param channelId id of the channel of which the content is requested
|
||||||
|
* @param contentIds ids of requested contents
|
||||||
|
* @param comments storage for the comments
|
||||||
|
* @return false if something failed, true otherwhise
|
||||||
|
*/
|
||||||
|
virtual bool getChannelComments(const RsGxsGroupId &channelId,
|
||||||
|
const std::set<RsGxsMessageId> &contentIds,
|
||||||
|
std::vector<RsGxsComment> &comments) = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Get channel content summaries
|
* @brief Get channel content summaries
|
||||||
* @jsonapi{development}
|
* @jsonapi{development}
|
||||||
|
|
|
@ -1142,6 +1142,25 @@ bool p3GxsChannels::getChannelContent( const RsGxsGroupId& channelId,
|
||||||
return getPostData(token, posts, comments);
|
return getPostData(token, posts, comments);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool p3GxsChannels::getChannelComments(const RsGxsGroupId &channelId,
|
||||||
|
const std::set<RsGxsMessageId> &contentIds,
|
||||||
|
std::vector<RsGxsComment> &comments)
|
||||||
|
{
|
||||||
|
std::vector<RsGxsGrpMsgIdPair> msgIds;
|
||||||
|
for (auto& msg:contentIds)
|
||||||
|
msgIds.push_back(RsGxsGrpMsgIdPair(channelId,msg));
|
||||||
|
|
||||||
|
RsTokReqOptions opts;
|
||||||
|
opts.mReqType = GXS_REQUEST_TYPE_MSG_RELATED_DATA;
|
||||||
|
opts.mOptions = RS_TOKREQOPT_MSG_THREAD | RS_TOKREQOPT_MSG_LATEST;
|
||||||
|
|
||||||
|
uint32_t token;
|
||||||
|
if( !requestMsgRelatedInfo(token, opts, msgIds) || waitToken(token) != RsTokenService::COMPLETE )
|
||||||
|
return false;
|
||||||
|
|
||||||
|
return getRelatedComments(token,comments);
|
||||||
|
}
|
||||||
|
|
||||||
bool p3GxsChannels::createChannelV2(
|
bool p3GxsChannels::createChannelV2(
|
||||||
const std::string& name, const std::string& description,
|
const std::string& name, const std::string& description,
|
||||||
const RsGxsImage& thumbnail, const RsGxsId& authorId,
|
const RsGxsImage& thumbnail, const RsGxsId& authorId,
|
||||||
|
|
|
@ -196,6 +196,11 @@ virtual bool ExtraFileRemove(const RsFileHash &hash);
|
||||||
std::vector<RsGxsChannelPost>& posts,
|
std::vector<RsGxsChannelPost>& posts,
|
||||||
std::vector<RsGxsComment>& comments ) override;
|
std::vector<RsGxsComment>& comments ) override;
|
||||||
|
|
||||||
|
/// Implementation of @see RsGxsChannels::getChannelComments
|
||||||
|
virtual bool getChannelComments(const RsGxsGroupId &channelId,
|
||||||
|
const std::set<RsGxsMessageId> &contentIds,
|
||||||
|
std::vector<RsGxsComment> &comments) override;
|
||||||
|
|
||||||
/// Implementation of @see RsGxsChannels::getContentSummaries
|
/// Implementation of @see RsGxsChannels::getContentSummaries
|
||||||
bool getContentSummaries(
|
bool getContentSummaries(
|
||||||
const RsGxsGroupId& channelId,
|
const RsGxsGroupId& channelId,
|
||||||
|
|
|
@ -385,7 +385,7 @@ void GxsChannelPostItem::loadComment()
|
||||||
std::vector<RsGxsChannelPost> posts;
|
std::vector<RsGxsChannelPost> posts;
|
||||||
std::vector<RsGxsComment> comments;
|
std::vector<RsGxsComment> comments;
|
||||||
|
|
||||||
if(! rsGxsChannels->getChannelContent( groupId(),msgIds,posts,comments))
|
if(! rsGxsChannels->getChannelComments( groupId(),msgIds,comments))
|
||||||
{
|
{
|
||||||
RsErr() << "GxsGxsChannelGroupItem::loadGroup() ERROR getting data" << std::endl;
|
RsErr() << "GxsGxsChannelGroupItem::loadGroup() ERROR getting data" << std::endl;
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue