mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-01-28 00:07:09 -05:00
added missing acknowledge token in channels and fasten up markAllRead by using async on each post
This commit is contained in:
parent
a7de50d4c8
commit
537957a2ea
@ -1777,12 +1777,13 @@ bool p3GxsChannels::createComment(RsGxsComment& comment) // deprecated
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool p3GxsChannels::subscribeToChannel(
|
bool p3GxsChannels::subscribeToChannel( const RsGxsGroupId& groupId, bool subscribe )
|
||||||
const RsGxsGroupId& groupId, bool subscribe )
|
|
||||||
{
|
{
|
||||||
uint32_t token;
|
uint32_t token;
|
||||||
if( !subscribeToGroup(token, groupId, subscribe)
|
if( !subscribeToGroup(token, groupId, subscribe) || waitToken(token) != RsTokenService::COMPLETE ) return false;
|
||||||
|| waitToken(token) != RsTokenService::COMPLETE ) return false;
|
|
||||||
|
RsGxsGroupId grpId;
|
||||||
|
acknowledgeGrp(token,grpId);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1791,6 +1792,10 @@ bool p3GxsChannels::markRead(const RsGxsGrpMsgIdPair& msgId, bool read)
|
|||||||
uint32_t token;
|
uint32_t token;
|
||||||
setMessageReadStatus(token, msgId, read);
|
setMessageReadStatus(token, msgId, read);
|
||||||
if(waitToken(token) != RsTokenService::COMPLETE ) return false;
|
if(waitToken(token) != RsTokenService::COMPLETE ) return false;
|
||||||
|
|
||||||
|
RsGxsGrpMsgIdPair p;
|
||||||
|
acknowledgeMsg(token,p);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -795,11 +795,11 @@ void RsGxsChannelPostsModel::setAllMsgReadStatus(bool read_status)
|
|||||||
|
|
||||||
// 2 - then call the async methods
|
// 2 - then call the async methods
|
||||||
|
|
||||||
RsThread::async([pairs, read_status]()
|
|
||||||
{
|
|
||||||
for(uint32_t i=0;i<pairs.size();++i)
|
for(uint32_t i=0;i<pairs.size();++i)
|
||||||
if(!rsGxsChannels->markRead(pairs[i],read_status))
|
RsThread::async([p=pairs[i], read_status]()
|
||||||
RsErr() << "setAllMsgReadStatus: failed to change status of msg " << pairs[i].first << " in group " << pairs[i].second << " to status " << read_status << std::endl;
|
{
|
||||||
|
if(!rsGxsChannels->markRead(p,read_status))
|
||||||
|
RsErr() << "setAllMsgReadStatus: failed to change status of msg " << p.first << " in group " << p.second << " to status " << read_status << std::endl;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user