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

@ -323,7 +323,20 @@ public:
std::vector<RsGxsChannelGroup>& channelsInfo ) = 0;
/**
* @brief Get channel contents
* @brief Get all channel messages and comments in a given channel
* @jsonapi{development}
* @param[in] channelId id of the channel of which the content is requested
* @param[out] posts storage for posts
* @param[out] comments storage for the comments
* @return false if something failed, true otherwhise
*/
virtual bool getChannelAllContent(const RsGxsGroupId& channelId,
std::vector<RsGxsChannelPost>& posts,
std::vector<RsGxsComment>& comments ) = 0;
/**
* @brief Get channel messages and comments corresponding to the given message ID list. If the list is empty, nothing is returned. Since
* comments are themselves messages, it is possible to get comments only by only supplying their message IDs.
* @jsonapi{development}
* @param[in] channelId id of the channel of which the content is requested
* @param[in] contentsIds ids of requested contents
@ -331,10 +344,10 @@ public:
* @param[out] comments storage for the comments
* @return false if something failed, true otherwhise
*/
virtual bool getChannelContent( const RsGxsGroupId& channelId,
const std::set<RsGxsMessageId>& contentsIds,
std::vector<RsGxsChannelPost>& posts,
std::vector<RsGxsComment>& comments ) = 0;
virtual bool getChannelContent(const RsGxsGroupId& channelId,
const std::set<RsGxsMessageId>& contentIds,
std::vector<RsGxsChannelPost>& posts,
std::vector<RsGxsComment>& comments ) = 0;
/**
* @brief Get channel content summaries

View file

@ -40,8 +40,11 @@
* are necessary, so at this point this workaround seems acceptable.
*/
#define DEBUG_GXSIFACEHELPER 1
enum class TokenRequestType: uint8_t
{
UNDEFINED = 0x00,
GROUP_INFO = 0x01,
POSTS = 0x02,
ALL_POSTS = 0x03,
@ -284,7 +287,8 @@ public:
if(mTokenService.requestMsgInfo(token, 0, opts, msgIds))
{
RS_STACK_MUTEX(mMtx);
mActiveTokens[token]= msgIds.empty()?(TokenRequestType::ALL_POSTS):(TokenRequestType::POSTS);
mActiveTokens[token]= (msgIds.size()==1 && msgIds.begin()->second.size()==0) ?(TokenRequestType::ALL_POSTS):(TokenRequestType::POSTS);
locked_dumpTokens();
return true;
}
@ -459,15 +463,15 @@ private:
uint32_t count[7] = {0};
std::cerr << "Service 0x0" << std::hex << service_id
std::cerr << "Service " << std::hex << service_id << std::dec
<< " (" << rsServiceControl->getServiceName(RsServiceInfo::RsServiceInfoUIn16ToFullServiceId(service_id))
<< ") this=0x" << (void*)this << ") Active tokens (per type): " ;
<< ") this=" << std::hex << (void*)this << std::dec << ") Active tokens (per type): " ;
for(auto& it: mActiveTokens) // let's count how many token of each type we've got.
++count[static_cast<int>(it.second)];
for(uint32_t i=0;i<7;++i)
std::cerr /* << i << ":" */ << count[i] << " ";
std::cerr << std::dec /* << i << ":" */ << count[i] << " ";
std::cerr << std::endl;
}
};

View file

@ -150,6 +150,11 @@ public:
virtual bool getBoardsSummaries(std::list<RsGroupMetaData>& groupInfo) =0;
virtual bool getBoardAllContent(
const RsGxsGroupId& boardId,
std::vector<RsPostedPost>& posts,
std::vector<RsGxsComment>& comments ) = 0;
virtual bool getBoardContent(
const RsGxsGroupId& boardId,
const std::set<RsGxsMessageId>& contentsIds,