mirror of
https://github.com/RetroShare/libretroshare.git
synced 2026-09-12 19:50:03 +05:00
Address review: identify posts by mThreadId alone
getChannelAllContent() split the metas into posts and comments/votes on "mThreadId.isNull() && mParentId.isNull()". Only the first half of that test carries information: a post never has a thread id, a comment always carries the id of the post it belongs to, and a vote the id of the post whose comment is being voted. mParentId proves nothing, since comments written under the old comment paradigm have a null one. Reported by csoler on PR #351. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
494ce38f11
commit
2a2a1e241e
@ -1552,8 +1552,14 @@ bool p3GxsChannels::getChannelAllContent( const RsGxsGroupId& channelId,
|
||||
std::vector<RsMsgMetaData> post_metas;
|
||||
std::set<RsGxsMessageId> wanted_msgs;
|
||||
|
||||
// Only mThreadId tells posts apart from the rest: a post never has one
|
||||
// (createChannelPost leaves it null), while a comment always carries the id
|
||||
// of the post it belongs to and a vote the id of the post being commented.
|
||||
// mParentId is not usable here: comments written under the old paradigm have
|
||||
// a null one.
|
||||
|
||||
for(auto& m: metas)
|
||||
if(m.mThreadId.isNull() && m.mParentId.isNull())
|
||||
if(m.mThreadId.isNull())
|
||||
post_metas.push_back(m);
|
||||
else
|
||||
wanted_msgs.insert(m.mMsgId); // comments and votes are all kept
|
||||
|
||||
Loading…
Reference in New Issue
Block a user