mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-12-17 20:04:22 -05:00
Merge pull request #1881 from PhenomRetroShare/Add_VotesOn_getPostData
Add Votes when calling getPostData.
This commit is contained in:
commit
2a5adddc3b
@ -314,7 +314,8 @@ public:
|
||||
*/
|
||||
virtual bool getChannelAllContent( const RsGxsGroupId& channelId,
|
||||
std::vector<RsGxsChannelPost>& posts,
|
||||
std::vector<RsGxsComment>& comments ) = 0;
|
||||
std::vector<RsGxsComment>& comments,
|
||||
std::vector<RsGxsVote>& votes ) = 0;
|
||||
|
||||
/**
|
||||
* @brief Get channel messages and comments corresponding to the given IDs.
|
||||
@ -326,12 +327,14 @@ public:
|
||||
* @param[in] contentsIds ids of requested contents
|
||||
* @param[out] posts storage for posts
|
||||
* @param[out] comments storage for the comments
|
||||
* @param[out] votes storage for the votes
|
||||
* @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;
|
||||
std::vector<RsGxsComment>& comments,
|
||||
std::vector<RsGxsVote>& votes ) = 0;
|
||||
|
||||
/**
|
||||
* @brief Get channel comments corresponding to the given IDs.
|
||||
@ -571,6 +574,9 @@ public:
|
||||
RS_DEPRECATED_FOR(getChannelsInfo)
|
||||
virtual bool getGroupData(const uint32_t &token, std::vector<RsGxsChannelGroup> &groups) = 0;
|
||||
|
||||
RS_DEPRECATED_FOR(getChannelContent)
|
||||
virtual bool getPostData(const uint32_t &token, std::vector<RsGxsChannelPost> &posts, std::vector<RsGxsComment> &cmts, std::vector<RsGxsVote> &votes) = 0;
|
||||
|
||||
RS_DEPRECATED_FOR(getChannelContent)
|
||||
virtual bool getPostData(const uint32_t &token, std::vector<RsGxsChannelPost> &posts, std::vector<RsGxsComment> &cmts) = 0;
|
||||
|
||||
|
@ -154,13 +154,15 @@ public:
|
||||
virtual bool getBoardAllContent(
|
||||
const RsGxsGroupId& boardId,
|
||||
std::vector<RsPostedPost>& posts,
|
||||
std::vector<RsGxsComment>& comments ) = 0;
|
||||
std::vector<RsGxsComment>& comments,
|
||||
std::vector<RsGxsVote>& votes ) = 0;
|
||||
|
||||
virtual bool getBoardContent(
|
||||
const RsGxsGroupId& boardId,
|
||||
const std::set<RsGxsMessageId>& contentsIds,
|
||||
std::vector<RsPostedPost>& posts,
|
||||
std::vector<RsGxsComment>& comments ) = 0;
|
||||
std::vector<RsGxsComment>& comments,
|
||||
std::vector<RsGxsVote>& votes ) = 0;
|
||||
|
||||
virtual bool editBoard(RsPostedGroup& board) =0;
|
||||
|
||||
@ -176,6 +178,11 @@ public:
|
||||
virtual bool getGroupData( const uint32_t& token,
|
||||
std::vector<RsPostedGroup> &groups ) = 0;
|
||||
|
||||
RS_DEPRECATED_FOR(getBoardsContent)
|
||||
virtual bool getPostData(
|
||||
const uint32_t& token, std::vector<RsPostedPost>& posts,
|
||||
std::vector<RsGxsComment>& cmts, std::vector<RsGxsVote>& vots) = 0;
|
||||
|
||||
RS_DEPRECATED_FOR(getBoardsContent)
|
||||
virtual bool getPostData(
|
||||
const uint32_t& token, std::vector<RsPostedPost>& posts,
|
||||
|
@ -452,16 +452,17 @@ bool p3GxsChannels::groupShareKeys(
|
||||
|
||||
bool p3GxsChannels::getPostData(
|
||||
const uint32_t &token, std::vector<RsGxsChannelPost> &msgs,
|
||||
std::vector<RsGxsComment> &cmts )
|
||||
std::vector<RsGxsComment> &cmts,
|
||||
std::vector<RsGxsVote> &vots)
|
||||
{
|
||||
#ifdef GXSCHANNELS_DEBUG
|
||||
std::cerr << __PRETTY_FUNCTION__ << std::cerr << std::endl;
|
||||
RsDbg() << __PRETTY_FUNCTION__ << std::endl;
|
||||
#endif
|
||||
|
||||
GxsMsgDataMap msgData;
|
||||
if(!RsGenExchange::getMsgData(token, msgData))
|
||||
{
|
||||
std::cerr << __PRETTY_FUNCTION__ <<" ERROR in request" << std::endl;
|
||||
RsErr() << __PRETTY_FUNCTION__ << " ERROR in request" << std::endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -495,39 +496,62 @@ bool p3GxsChannels::getPostData(
|
||||
cmt = cmtItem->mMsg;
|
||||
cmt.mMeta = mi->meta;
|
||||
#ifdef GXSCOMMENT_DEBUG
|
||||
std::cerr << "p3GxsChannels::getPostData Found Comment:" << std::endl;
|
||||
RsDbg() << __PRETTY_FUNCTION__ << " Found Comment:" << std::endl;
|
||||
cmt.print(std::cerr," ", "cmt");
|
||||
#endif
|
||||
cmts.push_back(cmt);
|
||||
delete cmtItem;
|
||||
}
|
||||
else
|
||||
{
|
||||
RsGxsVoteItem* votItem =
|
||||
dynamic_cast<RsGxsVoteItem*>(*vit);
|
||||
if(votItem)
|
||||
{
|
||||
RsGxsVote vot;
|
||||
RsGxsMsgItem *mi = (*vit);
|
||||
vot = votItem->mMsg;
|
||||
vot.mMeta = mi->meta;
|
||||
vots.push_back(vot);
|
||||
delete votItem;
|
||||
}
|
||||
else
|
||||
{
|
||||
RsGxsMsgItem* msg = (*vit);
|
||||
//const uint16_t RS_SERVICE_GXS_TYPE_CHANNELS = 0x0217;
|
||||
//const uint8_t RS_PKT_SUBTYPE_GXSCHANNEL_POST_ITEM = 0x03;
|
||||
//const uint8_t RS_PKT_SUBTYPE_GXSCOMMENT_COMMENT_ITEM = 0xf1;
|
||||
std::cerr << __PRETTY_FUNCTION__
|
||||
//const uint8_t RS_PKT_SUBTYPE_GXSCOMMENT_VOTE_ITEM = 0xf2;
|
||||
RsErr() << __PRETTY_FUNCTION__
|
||||
<< " Not a GxsChannelPostItem neither a "
|
||||
<< "RsGxsCommentItem PacketService=" << std::hex
|
||||
<< (int)msg->PacketService() << std::dec
|
||||
<< " PacketSubType=" << std::hex
|
||||
<< (int)msg->PacketSubType() << std::dec
|
||||
<< "RsGxsCommentItem neither a RsGxsVoteItem"
|
||||
<< " PacketService=" << std::hex << (int)msg->PacketService() << std::dec
|
||||
<< " PacketSubType=" << std::hex << (int)msg->PacketSubType() << std::dec
|
||||
<< " type name =" << typeid(*msg).name()
|
||||
<< " , deleting!" << std::endl;
|
||||
delete *vit;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool p3GxsChannels::getPostData(
|
||||
const uint32_t& token, std::vector<RsGxsChannelPost>& posts, std::vector<RsGxsComment>& cmts )
|
||||
{
|
||||
std::vector<RsGxsVote> vots;
|
||||
return getPostData(token, posts, cmts, vots);
|
||||
}
|
||||
|
||||
bool p3GxsChannels::getPostData(
|
||||
const uint32_t& token, std::vector<RsGxsChannelPost>& posts )
|
||||
{
|
||||
std::vector<RsGxsComment> cmts;
|
||||
return getPostData(token, posts, cmts);
|
||||
std::vector<RsGxsVote> vots;
|
||||
return getPostData(token, posts, cmts, vots);
|
||||
}
|
||||
|
||||
//Not currently used
|
||||
@ -1091,7 +1115,8 @@ bool p3GxsChannels::getContentSummaries(
|
||||
|
||||
bool p3GxsChannels::getChannelAllContent( const RsGxsGroupId& channelId,
|
||||
std::vector<RsGxsChannelPost>& posts,
|
||||
std::vector<RsGxsComment>& comments )
|
||||
std::vector<RsGxsComment>& comments,
|
||||
std::vector<RsGxsVote>& votes )
|
||||
{
|
||||
uint32_t token;
|
||||
RsTokReqOptions opts;
|
||||
@ -1100,13 +1125,14 @@ bool p3GxsChannels::getChannelAllContent( const RsGxsGroupId& channelId,
|
||||
if( !requestMsgInfo(token, opts,std::list<RsGxsGroupId>({channelId})) || waitToken(token) != RsTokenService::COMPLETE )
|
||||
return false;
|
||||
|
||||
return getPostData(token, posts, comments);
|
||||
return getPostData(token, posts, comments,votes);
|
||||
}
|
||||
|
||||
bool p3GxsChannels::getChannelContent( const RsGxsGroupId& channelId,
|
||||
const std::set<RsGxsMessageId>& contentIds,
|
||||
std::vector<RsGxsChannelPost>& posts,
|
||||
std::vector<RsGxsComment>& comments )
|
||||
std::vector<RsGxsComment>& comments,
|
||||
std::vector<RsGxsVote>& votes )
|
||||
{
|
||||
uint32_t token;
|
||||
RsTokReqOptions opts;
|
||||
@ -1118,7 +1144,7 @@ bool p3GxsChannels::getChannelContent( const RsGxsGroupId& channelId,
|
||||
if( !requestMsgInfo(token, opts, msgIds) || waitToken(token) != RsTokenService::COMPLETE )
|
||||
return false;
|
||||
|
||||
return getPostData(token, posts, comments);
|
||||
return getPostData(token, posts, comments, votes);
|
||||
}
|
||||
|
||||
bool p3GxsChannels::getChannelComments(const RsGxsGroupId &channelId,
|
||||
@ -1293,8 +1319,9 @@ bool p3GxsChannels::createVoteV2(
|
||||
std::set<RsGxsMessageId> s({commentId});
|
||||
std::vector<RsGxsChannelPost> posts;
|
||||
std::vector<RsGxsComment> comments;
|
||||
std::vector<RsGxsVote> votes;
|
||||
|
||||
if(!getChannelContent(channelId, s, posts, comments))
|
||||
if(!getChannelContent(channelId, s, posts, comments, votes))
|
||||
{
|
||||
errorMessage = "You cannot vote on comment "
|
||||
+ commentId.toStdString() + " of channel with Id "
|
||||
@ -1454,8 +1481,9 @@ bool p3GxsChannels::createPostV2(
|
||||
std::set<RsGxsMessageId> s({origPostId});
|
||||
std::vector<RsGxsChannelPost> posts;
|
||||
std::vector<RsGxsComment> comments;
|
||||
std::vector<RsGxsVote> votes;
|
||||
|
||||
if(!getChannelContent(channelId,s,posts,comments))
|
||||
if(!getChannelContent(channelId,s,posts,comments,votes))
|
||||
{
|
||||
errorMessage = "You cannot edit post " + origPostId.toStdString()
|
||||
+ " of channel with Id " + channelId.toStdString()
|
||||
@ -1525,9 +1553,11 @@ bool p3GxsChannels::createCommentV2(
|
||||
|
||||
std::vector<RsGxsChannelPost> posts;
|
||||
std::vector<RsGxsComment> comments;
|
||||
std::vector<RsGxsVote> votes;
|
||||
|
||||
if(!getChannelContent( // does the post thread exist?
|
||||
channelId,std::set<RsGxsMessageId>({threadId}), posts, comments ))
|
||||
channelId, std::set<RsGxsMessageId>({threadId}),
|
||||
posts, comments, votes) )
|
||||
return failure( "You cannot comment post " + threadId.toStdString() +
|
||||
" of channel with Id " + channelId.toStdString() +
|
||||
": this post does not exists locally!" );
|
||||
@ -1539,19 +1569,18 @@ bool p3GxsChannels::createCommentV2(
|
||||
": supplied threadId is not a thread, or parentMsgId is"
|
||||
" not a comment!");
|
||||
|
||||
if(!getChannelContent( // does the post thread exist?
|
||||
if(!getChannelContent( // does the post parent exist?
|
||||
channelId, std::set<RsGxsMessageId>({parentId}),
|
||||
posts, comments ))
|
||||
posts, comments, votes) )
|
||||
return failure( "You cannot comment post " + parentId.toStdString() +
|
||||
": supplied parent doesn't exists locally!" );
|
||||
|
||||
if(!origCommentId.isNull())
|
||||
{
|
||||
std::set<RsGxsMessageId> s({origCommentId});
|
||||
std::vector<RsGxsChannelPost> posts;
|
||||
std::vector<RsGxsComment> comments;
|
||||
std::vector<RsGxsComment> cmts;
|
||||
|
||||
if( !getChannelContent(channelId, s, posts, comments) ||
|
||||
if( !getChannelContent(channelId, s, posts, cmts, votes) ||
|
||||
comments.size() != 1 )
|
||||
return failure( "You cannot edit comment " +
|
||||
origCommentId.toStdString() +
|
||||
|
@ -82,9 +82,10 @@ virtual void handle_event(uint32_t event_type, const std::string &elabel);
|
||||
|
||||
public:
|
||||
|
||||
virtual bool getGroupData(const uint32_t &token, std::vector<RsGxsChannelGroup> &groups);
|
||||
virtual bool getPostData(const uint32_t &token, std::vector<RsGxsChannelPost> &posts, std::vector<RsGxsComment> &cmts);
|
||||
virtual bool getPostData(const uint32_t &token, std::vector<RsGxsChannelPost> &posts);
|
||||
virtual bool getGroupData(const uint32_t &token, std::vector<RsGxsChannelGroup> &groups ) override;
|
||||
virtual bool getPostData(const uint32_t &token, std::vector<RsGxsChannelPost> &posts, std::vector<RsGxsComment> &cmts, std::vector<RsGxsVote> &vots) override;
|
||||
virtual bool getPostData(const uint32_t &token, std::vector<RsGxsChannelPost> &posts, std::vector<RsGxsComment> &cmts) override;
|
||||
virtual bool getPostData(const uint32_t &token, std::vector<RsGxsChannelPost> &posts) override;
|
||||
//Not currently used
|
||||
//virtual bool getRelatedPosts(const uint32_t &token, std::vector<RsGxsChannelPost> &posts);
|
||||
|
||||
@ -188,13 +189,15 @@ virtual bool ExtraFileRemove(const RsFileHash &hash);
|
||||
/// Implementation of @see RsGxsChannels::getChannelAllMessages
|
||||
bool getChannelAllContent(const RsGxsGroupId& channelId,
|
||||
std::vector<RsGxsChannelPost>& posts,
|
||||
std::vector<RsGxsComment>& comments ) override;
|
||||
std::vector<RsGxsComment>& comments,
|
||||
std::vector<RsGxsVote>& votes ) 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;
|
||||
std::vector<RsGxsComment>& comments,
|
||||
std::vector<RsGxsVote>& votes ) override;
|
||||
|
||||
/// Implementation of @see RsGxsChannels::getChannelComments
|
||||
virtual bool getChannelComments(const RsGxsGroupId &channelId,
|
||||
|
@ -94,19 +94,23 @@ bool p3Posted::getGroupData(const uint32_t &token, std::vector<RsPostedGroup> &g
|
||||
return ok;
|
||||
}
|
||||
|
||||
bool p3Posted::getPostData(const uint32_t &token, std::vector<RsPostedPost> &msgs, std::vector<RsGxsComment> &cmts)
|
||||
bool p3Posted::getPostData(
|
||||
const uint32_t &token, std::vector<RsPostedPost> &msgs,
|
||||
std::vector<RsGxsComment> &cmts,
|
||||
std::vector<RsGxsVote> &vots)
|
||||
{
|
||||
#ifdef POSTED_DEBUG
|
||||
std::cerr << "p3Posted::getPostData()";
|
||||
std::cerr << std::endl;
|
||||
RsDbg() << __PRETTY_FUNCTION__ << std::endl;
|
||||
#endif
|
||||
|
||||
GxsMsgDataMap msgData;
|
||||
bool ok = RsGenExchange::getMsgData(token, msgData);
|
||||
rstime_t now = time(NULL);
|
||||
|
||||
if(ok)
|
||||
if(!RsGenExchange::getMsgData(token, msgData))
|
||||
{
|
||||
RsErr() << __PRETTY_FUNCTION__ << " ERROR in request" << std::endl;
|
||||
return false;
|
||||
}
|
||||
|
||||
GxsMsgDataMap::iterator mit = msgData.begin();
|
||||
|
||||
for(; mit != msgData.end(); ++mit)
|
||||
@ -116,10 +120,12 @@ bool p3Posted::getPostData(const uint32_t &token, std::vector<RsPostedPost> &msg
|
||||
|
||||
for(; vit != msgItems.end(); ++vit)
|
||||
{
|
||||
RsGxsPostedPostItem* postItem = dynamic_cast<RsGxsPostedPostItem*>(*vit);
|
||||
RsGxsPostedPostItem* postItem =
|
||||
dynamic_cast<RsGxsPostedPostItem*>(*vit);
|
||||
|
||||
if(postItem)
|
||||
{
|
||||
// TODO Really needed all of these lines?
|
||||
RsPostedPost msg = postItem->mPost;
|
||||
msg.mMeta = postItem->meta;
|
||||
postItem->toPostedPost(msg, true);
|
||||
@ -130,7 +136,8 @@ bool p3Posted::getPostData(const uint32_t &token, std::vector<RsPostedPost> &msg
|
||||
}
|
||||
else
|
||||
{
|
||||
RsGxsCommentItem* cmtItem = dynamic_cast<RsGxsCommentItem*>(*vit);
|
||||
RsGxsCommentItem* cmtItem =
|
||||
dynamic_cast<RsGxsCommentItem*>(*vit);
|
||||
if(cmtItem)
|
||||
{
|
||||
RsGxsComment cmt;
|
||||
@ -138,19 +145,35 @@ bool p3Posted::getPostData(const uint32_t &token, std::vector<RsPostedPost> &msg
|
||||
cmt = cmtItem->mMsg;
|
||||
cmt.mMeta = mi->meta;
|
||||
#ifdef GXSCOMMENT_DEBUG
|
||||
std::cerr << "p3Posted::getPostData Found Comment:" << std::endl;
|
||||
RsDbg() << __PRETTY_FUNCTION__ << " Found Comment:" << std::endl;
|
||||
cmt.print(std::cerr," ", "cmt");
|
||||
#endif
|
||||
cmts.push_back(cmt);
|
||||
delete cmtItem;
|
||||
}
|
||||
else
|
||||
{
|
||||
RsGxsVoteItem* votItem =
|
||||
dynamic_cast<RsGxsVoteItem*>(*vit);
|
||||
if(votItem)
|
||||
{
|
||||
RsGxsVote vot;
|
||||
RsGxsMsgItem *mi = (*vit);
|
||||
vot = votItem->mMsg;
|
||||
vot.mMeta = mi->meta;
|
||||
vots.push_back(vot);
|
||||
delete votItem;
|
||||
}
|
||||
else
|
||||
{
|
||||
RsGxsMsgItem* msg = (*vit);
|
||||
//const uint16_t RS_SERVICE_GXS_TYPE_CHANNELS = 0x0217;
|
||||
//const uint8_t RS_PKT_SUBTYPE_GXSCHANNEL_POST_ITEM = 0x03;
|
||||
//const uint8_t RS_PKT_SUBTYPE_GXSCOMMENT_COMMENT_ITEM = 0xf1;
|
||||
std::cerr << "Not a PostedPostItem neither a RsGxsCommentItem"
|
||||
//const uint8_t RS_PKT_SUBTYPE_GXSCOMMENT_VOTE_ITEM = 0xf2;
|
||||
RsErr() << __PRETTY_FUNCTION__
|
||||
<< "Not a PostedPostItem neither a "
|
||||
<< "RsGxsCommentItem neither a RsGxsVoteItem"
|
||||
<< " PacketService=" << std::hex << (int)msg->PacketService() << std::dec
|
||||
<< " PacketSubType=" << std::hex << (int)msg->PacketSubType() << std::dec
|
||||
<< " type name =" << typeid(*msg).name()
|
||||
@ -161,13 +184,23 @@ bool p3Posted::getPostData(const uint32_t &token, std::vector<RsPostedPost> &msg
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
std::cerr << "p3GxsChannels::getPostData() ERROR in request";
|
||||
std::cerr << std::endl;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return ok;
|
||||
bool p3Posted::getPostData(
|
||||
const uint32_t &token, std::vector<RsPostedPost> &posts, std::vector<RsGxsComment> &cmts)
|
||||
{
|
||||
std::vector<RsGxsVote> vots;
|
||||
return getPostData( token, posts, cmts, vots);
|
||||
}
|
||||
|
||||
bool p3Posted::getPostData(
|
||||
const uint32_t &token, std::vector<RsPostedPost> &posts)
|
||||
{
|
||||
std::vector<RsGxsComment> cmts;
|
||||
std::vector<RsGxsVote> vots;
|
||||
return getPostData( token, posts, cmts, vots);
|
||||
}
|
||||
|
||||
//Not currently used
|
||||
@ -324,7 +357,8 @@ bool p3Posted::getBoardsInfo(
|
||||
|
||||
bool p3Posted::getBoardAllContent( const RsGxsGroupId& groupId,
|
||||
std::vector<RsPostedPost>& posts,
|
||||
std::vector<RsGxsComment>& comments )
|
||||
std::vector<RsGxsComment>& comments,
|
||||
std::vector<RsGxsVote>& votes )
|
||||
{
|
||||
uint32_t token;
|
||||
RsTokReqOptions opts;
|
||||
@ -333,13 +367,14 @@ bool p3Posted::getBoardAllContent( const RsGxsGroupId& groupId,
|
||||
if( !requestMsgInfo(token, opts, std::list<RsGxsGroupId>({groupId})) || waitToken(token) != RsTokenService::COMPLETE )
|
||||
return false;
|
||||
|
||||
return getPostData(token, posts, comments);
|
||||
return getPostData(token, posts, comments, votes);
|
||||
}
|
||||
|
||||
bool p3Posted::getBoardContent( const RsGxsGroupId& groupId,
|
||||
const std::set<RsGxsMessageId>& contentsIds,
|
||||
std::vector<RsPostedPost>& posts,
|
||||
std::vector<RsGxsComment>& comments )
|
||||
std::vector<RsGxsComment>& comments,
|
||||
std::vector<RsGxsVote>& votes )
|
||||
{
|
||||
uint32_t token;
|
||||
RsTokReqOptions opts;
|
||||
@ -351,7 +386,7 @@ bool p3Posted::getBoardContent( const RsGxsGroupId& groupId,
|
||||
if( !requestMsgInfo(token, opts, msgIds) ||
|
||||
waitToken(token) != RsTokenService::COMPLETE ) return false;
|
||||
|
||||
return getPostData(token, posts, comments);
|
||||
return getPostData(token, posts, comments, votes);
|
||||
}
|
||||
|
||||
bool p3Posted::getBoardsSummaries(std::list<RsGroupMetaData>& boards )
|
||||
|
@ -65,12 +65,14 @@ virtual void receiveHelperChanges(std::vector<RsGxsNotify*>& changes)
|
||||
|
||||
bool getBoardAllContent(const RsGxsGroupId& groupId,
|
||||
std::vector<RsPostedPost>& posts,
|
||||
std::vector<RsGxsComment>& comments ) override;
|
||||
std::vector<RsGxsComment>& comments,
|
||||
std::vector<RsGxsVote>& votes ) override;
|
||||
|
||||
bool getBoardContent(const RsGxsGroupId& groupId,
|
||||
const std::set<RsGxsMessageId>& contentsIds,
|
||||
std::vector<RsPostedPost>& posts,
|
||||
std::vector<RsGxsComment>& comments ) override;
|
||||
std::vector<RsGxsComment>& comments,
|
||||
std::vector<RsGxsVote>& votes ) override;
|
||||
|
||||
bool getBoardsSummaries(std::list<RsGroupMetaData>& groupInfo) override;
|
||||
|
||||
@ -82,9 +84,10 @@ virtual void receiveHelperChanges(std::vector<RsGxsNotify*>& changes)
|
||||
|
||||
bool createBoard(RsPostedGroup& board) override;
|
||||
|
||||
virtual bool getGroupData(const uint32_t &token, std::vector<RsPostedGroup> &groups);
|
||||
virtual bool getPostData(const uint32_t &token, std::vector<RsPostedPost> &posts, std::vector<RsGxsComment> &cmts);
|
||||
virtual bool getPostData(const uint32_t &token, std::vector<RsPostedPost> &posts) { std::vector<RsGxsComment> cmts; return getPostData( token, posts, cmts);}
|
||||
virtual bool getGroupData(const uint32_t &token, std::vector<RsPostedGroup> &groups) override;
|
||||
virtual bool getPostData(const uint32_t &token, std::vector<RsPostedPost> &posts, std::vector<RsGxsComment> &cmts, std::vector<RsGxsVote> &vots) override;
|
||||
virtual bool getPostData(const uint32_t &token, std::vector<RsPostedPost> &posts, std::vector<RsGxsComment> &cmts) override;
|
||||
virtual bool getPostData(const uint32_t &token, std::vector<RsPostedPost> &posts) override;
|
||||
//Not currently used
|
||||
//virtual bool getRelatedPosts(const uint32_t &token, std::vector<RsPostedPost> &posts);
|
||||
|
||||
|
@ -167,8 +167,9 @@ void BasePostedItem::loadMessage()
|
||||
|
||||
std::vector<RsPostedPost> posts;
|
||||
std::vector<RsGxsComment> comments;
|
||||
std::vector<RsGxsVote> votes;
|
||||
|
||||
if(! rsPosted->getBoardContent( groupId(), std::set<RsGxsMessageId>( { messageId() } ),posts,comments))
|
||||
if(! rsPosted->getBoardContent( groupId(), std::set<RsGxsMessageId>( { messageId() } ),posts,comments,votes))
|
||||
{
|
||||
RsErr() << "BasePostedItem::loadMessage() ERROR getting data" << std::endl;
|
||||
mIsLoadingMessage = false;
|
||||
@ -227,8 +228,9 @@ void BasePostedItem::loadComment()
|
||||
|
||||
std::vector<RsPostedPost> posts;
|
||||
std::vector<RsGxsComment> comments;
|
||||
std::vector<RsGxsVote> votes;
|
||||
|
||||
if(! rsPosted->getBoardContent( groupId(),msgIds,posts,comments))
|
||||
if(! rsPosted->getBoardContent( groupId(),msgIds,posts,comments,votes))
|
||||
{
|
||||
RsErr() << "BasePostedItem::loadGroup() ERROR getting data" << std::endl;
|
||||
mIsLoadingComment = false;
|
||||
|
@ -1033,8 +1033,9 @@ void PostedListWidget::getMsgData(const std::set<RsGxsMessageId>& msgIds,std::ve
|
||||
{
|
||||
std::vector<RsPostedPost> posts;
|
||||
std::vector<RsGxsComment> comments;
|
||||
std::vector<RsGxsVote> votes;
|
||||
|
||||
rsPosted->getBoardContent( groupId(),msgIds,posts,comments );
|
||||
rsPosted->getBoardContent( groupId(),msgIds,posts,comments,votes );
|
||||
|
||||
psts.clear();
|
||||
|
||||
@ -1046,8 +1047,9 @@ void PostedListWidget::getAllMsgData(std::vector<RsGxsGenericMsgData*>& psts)
|
||||
{
|
||||
std::vector<RsPostedPost> posts;
|
||||
std::vector<RsGxsComment> comments;
|
||||
std::vector<RsGxsVote> votes;
|
||||
|
||||
rsPosted->getBoardAllContent( groupId(),posts,comments );
|
||||
rsPosted->getBoardAllContent( groupId(),posts,comments,votes );
|
||||
|
||||
psts.clear();
|
||||
|
||||
|
@ -319,8 +319,9 @@ void GxsChannelPostItem::loadMessage()
|
||||
|
||||
std::vector<RsGxsChannelPost> posts;
|
||||
std::vector<RsGxsComment> comments;
|
||||
std::vector<RsGxsVote> votes;
|
||||
|
||||
if(! rsGxsChannels->getChannelContent( groupId(), std::set<RsGxsMessageId>( { messageId() } ),posts,comments))
|
||||
if(! rsGxsChannels->getChannelContent( groupId(), std::set<RsGxsMessageId>( { messageId() } ),posts,comments,votes))
|
||||
{
|
||||
RsErr() << "GxsGxsChannelGroupItem::loadGroup() ERROR getting data" << std::endl;
|
||||
return;
|
||||
|
@ -738,8 +738,9 @@ void CreateGxsChannelMsg::loadOriginalChannelPostInfo()
|
||||
{
|
||||
std::vector<RsGxsChannelPost> posts;
|
||||
std::vector<RsGxsComment> comments;
|
||||
std::vector<RsGxsVote> votes;
|
||||
|
||||
if( !rsGxsChannels->getChannelContent(mChannelId,std::set<RsGxsMessageId>({mOrigPostId}),posts,comments) || posts.size() != 1)
|
||||
if( !rsGxsChannels->getChannelContent(mChannelId,std::set<RsGxsMessageId>({mOrigPostId}),posts,comments,votes) || posts.size() != 1)
|
||||
{
|
||||
std::cerr << "Cannot get channel post data for channel " << mChannelId << " and post " << mOrigPostId << std::endl;
|
||||
return;
|
||||
|
@ -694,7 +694,7 @@ void GxsChannelPostsWidget::insertChannelPosts(std::vector<RsGxsChannelPost>& po
|
||||
break;
|
||||
|
||||
if (thread)
|
||||
thread->emitAddPost(qVariantFromValue(*it), related, ++pos, count);
|
||||
thread->emitAddPost(QVariant::fromValue(*it), related, ++pos, count);
|
||||
else
|
||||
createPostItem(*it, related);
|
||||
}
|
||||
@ -812,8 +812,9 @@ void GxsChannelPostsWidget::getMsgData(const std::set<RsGxsMessageId>& msgIds,st
|
||||
{
|
||||
std::vector<RsGxsChannelPost> posts;
|
||||
std::vector<RsGxsComment> comments;
|
||||
std::vector<RsGxsVote> votes;
|
||||
|
||||
rsGxsChannels->getChannelContent( groupId(),msgIds,posts,comments );
|
||||
rsGxsChannels->getChannelContent( groupId(),msgIds,posts,comments,votes );
|
||||
|
||||
psts.clear();
|
||||
|
||||
@ -825,8 +826,9 @@ void GxsChannelPostsWidget::getAllMsgData(std::vector<RsGxsGenericMsgData*>& pst
|
||||
{
|
||||
std::vector<RsGxsChannelPost> posts;
|
||||
std::vector<RsGxsComment> comments;
|
||||
std::vector<RsGxsVote> votes;
|
||||
|
||||
rsGxsChannels->getChannelAllContent( groupId(),posts,comments );
|
||||
rsGxsChannels->getChannelAllContent( groupId(),posts,comments,votes );
|
||||
|
||||
psts.clear();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user