Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/retroshare/rswire.h
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,10 @@ virtual bool getPulseFocus(const RsGxsGroupId &groupId, const RsGxsMessageId &ms
virtual bool getWireStatistics(const RsGxsGroupId& wireId, RsWireStatistics& stat) = 0;
virtual bool getWireGroupStatistics(const RsGxsGroupId& wireId,GxsGroupStatistic& stat) = 0;

// Mark a single pulse as read/unread. Blocking, no token management needed.
virtual bool setMessageReadStatus(const RsGxsGrpMsgIdPair& msgId, bool read) = 0;

RS_DEPRECATED_FOR(setMessageReadStatus)
virtual void setMessageReadStatus(uint32_t& token, const RsGxsGrpMsgIdPair& msgId, bool read) = 0;

virtual bool getContentSummaries( const RsGxsGroupId& groupId,
Expand Down
16 changes: 16 additions & 0 deletions src/services/p3wire.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1866,6 +1866,22 @@ bool p3Wire::getWireStatistics(const RsGxsGroupId& groupId, RsWireStatistics& st
/********************************************************************************************/
/********************************************************************************************/

bool p3Wire::setMessageReadStatus(const RsGxsGrpMsgIdPair &msgId, bool read)
{
uint32_t token;
setMessageReadStatus(token, msgId, read);

if (waitToken(token, std::chrono::seconds(5)) != RsTokenService::COMPLETE)
{
std::cerr << "p3Wire::setMessageReadStatus() waitToken failed" << std::endl;
return false;
}

RsGxsGrpMsgIdPair p;
acknowledgeMsg(token, p);
return true;
}

void p3Wire::setMessageReadStatus(uint32_t &token, const RsGxsGrpMsgIdPair &msgId, bool read)
{
#ifdef GXSWIRE_DEBUG
Expand Down
1 change: 1 addition & 0 deletions src/services/p3wire.h
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ class p3Wire: public RsGenExchange, public RsWire, public p3Config
bool getWireStatistics(const RsGxsGroupId& groupId,RsWireStatistics& stat) override;

bool getWireGroupStatistics(const RsGxsGroupId& groupId,GxsGroupStatistic& stat) override;
bool setMessageReadStatus(const RsGxsGrpMsgIdPair& msgId, bool read) override;
void setMessageReadStatus(uint32_t& token, const RsGxsGrpMsgIdPair& msgId, bool read) override;

bool subscribeToGroup(uint32_t& token, const RsGxsGroupId& groupId, bool subscribe) override;
Expand Down
Loading