finished converting GxsMessageFrameWidget to blocking API

This commit is contained in:
csoler 2020-03-31 20:21:16 +02:00
parent 55c810f848
commit cf7a77e512
No known key found for this signature in database
GPG key ID: 7BCA522266C0804C
13 changed files with 98 additions and 41 deletions

View file

@ -1083,20 +1083,34 @@ bool p3GxsChannels::getContentSummaries(
return res;
}
bool p3GxsChannels::getChannelAllContent( const RsGxsGroupId& channelId,
std::vector<RsGxsChannelPost>& posts,
std::vector<RsGxsComment>& comments )
{
uint32_t token;
RsTokReqOptions opts;
opts.mReqType = GXS_REQUEST_TYPE_MSG_DATA;
if( !requestMsgInfo(token, opts,std::list<RsGxsGroupId>({channelId})) || waitToken(token) != RsTokenService::COMPLETE )
return false;
return getPostData(token, posts, comments);
}
bool p3GxsChannels::getChannelContent( const RsGxsGroupId& channelId,
const std::set<RsGxsMessageId>& contentsIds,
std::vector<RsGxsChannelPost>& posts,
std::vector<RsGxsComment>& comments )
const std::set<RsGxsMessageId>& contentIds,
std::vector<RsGxsChannelPost>& posts,
std::vector<RsGxsComment>& comments )
{
uint32_t token;
RsTokReqOptions opts;
opts.mReqType = GXS_REQUEST_TYPE_MSG_DATA;
GxsMsgReq msgIds;
msgIds[channelId] = contentsIds;
msgIds[channelId] = contentIds;
if( !requestMsgInfo(token, opts, msgIds) ||
waitToken(token) != RsTokenService::COMPLETE ) return false;
if( !requestMsgInfo(token, opts, msgIds) || waitToken(token) != RsTokenService::COMPLETE )
return false;
return getPostData(token, posts, comments);
}

View file

@ -185,9 +185,14 @@ virtual bool ExtraFileRemove(const RsFileHash &hash);
const std::list<RsGxsGroupId>& chanIds,
std::vector<RsGxsChannelGroup>& channelsInfo ) override;
/// Implementation of @see RsGxsChannels::getChannelContent
bool getChannelContent( const RsGxsGroupId& channelId,
const std::set<RsGxsMessageId>& contentsIds,
/// Implementation of @see RsGxsChannels::getChannelAllMessages
bool getChannelAllContent(const RsGxsGroupId& channelId,
std::vector<RsGxsChannelPost>& posts,
std::vector<RsGxsComment>& comments ) override;
/// Implementation of @see RsGxsChannels::getChannelMessages
bool getChannelContent(const RsGxsGroupId& channelId,
const std::set<RsGxsMessageId>& contentIds,
std::vector<RsGxsChannelPost>& posts,
std::vector<RsGxsComment>& comments ) override;

View file

@ -322,6 +322,20 @@ bool p3Posted::getBoardsInfo(
return getGroupData(token, groupsInfo) && !groupsInfo.empty();
}
bool p3Posted::getBoardAllContent( const RsGxsGroupId& groupId,
std::vector<RsPostedPost>& posts,
std::vector<RsGxsComment>& comments )
{
uint32_t token;
RsTokReqOptions opts;
opts.mReqType = GXS_REQUEST_TYPE_MSG_DATA;
if( !requestMsgInfo(token, opts, std::list<RsGxsGroupId>({groupId})) || waitToken(token) != RsTokenService::COMPLETE )
return false;
return getPostData(token, posts, comments);
}
bool p3Posted::getBoardContent( const RsGxsGroupId& groupId,
const std::set<RsGxsMessageId>& contentsIds,
std::vector<RsPostedPost>& posts,

View file

@ -61,6 +61,10 @@ virtual void receiveHelperChanges(std::vector<RsGxsNotify*>& changes)
bool getBoardsInfo(const std::list<RsGxsGroupId>& boardsIds,
std::vector<RsPostedGroup>& groupsInfo ) override;
bool getBoardAllContent(const RsGxsGroupId& groupId,
std::vector<RsPostedPost>& posts,
std::vector<RsGxsComment>& comments ) override;
bool getBoardContent(const RsGxsGroupId& groupId,
const std::set<RsGxsMessageId>& contentsIds,
std::vector<RsPostedPost>& posts,