mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-12-11 23:05:49 -05:00
finished converting GxsMessageFrameWidget to blocking API
This commit is contained in:
parent
55c810f848
commit
cf7a77e512
13 changed files with 98 additions and 41 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
};
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue