mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-04 15:15:15 -04:00
added blocking API for createComment() in GxsCommentService and removed token queue from GxsCreateCommentDialog
This commit is contained in:
parent
ab2c1f23e9
commit
dc3c3488df
11 changed files with 26 additions and 31 deletions
|
@ -157,7 +157,9 @@ struct RsGxsCommentService
|
|||
virtual bool getRelatedComments( uint32_t token,
|
||||
std::vector<RsGxsComment> &comments ) = 0;
|
||||
|
||||
virtual bool createNewComment(uint32_t &token, RsGxsComment &comment) = 0;
|
||||
virtual bool createNewComment(uint32_t &token, const RsGxsComment &comment) = 0; // async API
|
||||
virtual bool createComment(RsGxsComment& comment) = 0; // blocking API. Updates comment with new metadata.
|
||||
|
||||
virtual bool createNewVote(uint32_t &token, RsGxsVote &vote) = 0;
|
||||
|
||||
virtual bool acknowledgeComment(
|
||||
|
|
|
@ -140,7 +140,7 @@ virtual bool getChannelDownloadDirectory(const RsGxsGroupId &groupId, std::strin
|
|||
std::vector<RsGxsComment> &msgs ) override
|
||||
{ return mCommentService->getGxsRelatedComments(token, msgs); }
|
||||
|
||||
virtual bool createNewComment(uint32_t &token, RsGxsComment &msg) override
|
||||
virtual bool createNewComment(uint32_t &token, const RsGxsComment &msg) override
|
||||
{
|
||||
return mCommentService->createGxsComment(token, msg);
|
||||
}
|
||||
|
@ -277,7 +277,7 @@ virtual bool ExtraFileRemove(const RsFileHash &hash);
|
|||
|
||||
/// @deprecated Implementation of @see RsGxsChannels::createComment
|
||||
RS_DEPRECATED_FOR(createCommentV2)
|
||||
bool createComment(RsGxsComment& comment) override;
|
||||
bool createComment(RsGxsComment &comment) override;
|
||||
|
||||
/// @deprecated Implementation of @see RsGxsChannels::createVote
|
||||
RS_DEPRECATED_FOR(createVoteV2)
|
||||
|
|
|
@ -425,7 +425,7 @@ double p3GxsCommentService::calculateBestScore(int upVotes, int downVotes)
|
|||
|
||||
/********************************************************************************************/
|
||||
|
||||
bool p3GxsCommentService::createGxsComment(uint32_t &token, RsGxsComment &msg)
|
||||
bool p3GxsCommentService::createGxsComment(uint32_t &token, const RsGxsComment &msg)
|
||||
{
|
||||
#ifdef DEBUG_GXSCOMMON
|
||||
std::cerr << "p3GxsCommentService::createGxsComment() GroupId: " << msg.mMeta.mGroupId;
|
||||
|
|
|
@ -66,7 +66,7 @@ class p3GxsCommentService: public GxsTokenQueue
|
|||
bool getGxsCommentData(const uint32_t &token, std::vector<RsGxsComment> &msgs);
|
||||
bool getGxsRelatedComments(const uint32_t &token, std::vector<RsGxsComment> &msgs);
|
||||
|
||||
bool createGxsComment(uint32_t &token, RsGxsComment &msg);
|
||||
bool createGxsComment(uint32_t &token, const RsGxsComment &msg);
|
||||
bool createGxsVote(uint32_t &token, RsGxsVote &msg);
|
||||
|
||||
// Special Acknowledge.
|
||||
|
|
|
@ -85,7 +85,7 @@ public:
|
|||
return mCommentService->getGxsRelatedComments(token, msgs);
|
||||
}
|
||||
|
||||
virtual bool createNewComment(uint32_t &token, RsGxsComment &msg) override
|
||||
virtual bool createNewComment(uint32_t &token, const RsGxsComment &msg) override
|
||||
{
|
||||
return mCommentService->createGxsComment(token, msg);
|
||||
}
|
||||
|
|
|
@ -96,10 +96,16 @@ virtual void setMessageReadStatus(uint32_t& token, const RsGxsGrpMsgIdPair& msgI
|
|||
std::vector<RsGxsComment> &msgs )
|
||||
{ return mCommentService->getGxsRelatedComments(token, msgs); }
|
||||
|
||||
virtual bool createNewComment(uint32_t &token, RsGxsComment &msg)
|
||||
virtual bool createNewComment(uint32_t &token, const RsGxsComment &msg) override
|
||||
{
|
||||
return mCommentService->createGxsComment(token, msg);
|
||||
}
|
||||
virtual bool createComment(RsGxsComment& msg) override
|
||||
{
|
||||
uint32_t token;
|
||||
|
||||
return mCommentService->createGxsComment(token, msg) && waitToken(token) == RsTokenService::COMPLETE ;
|
||||
}
|
||||
|
||||
virtual bool createNewVote(uint32_t &token, RsGxsVote &msg)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue