|
|
|
@ -55,8 +55,18 @@ module.exports = function (Topics) {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Topics.calculatePostIndices(replies, repliesStart);
|
|
|
|
|
postData = await user.blocks.filter(uid, postData);
|
|
|
|
|
await addEventStartEnd(postData, set, reverse, topicData);
|
|
|
|
|
const allPosts = postData.slice();
|
|
|
|
|
postData = await user.blocks.filter(uid, postData);
|
|
|
|
|
if (allPosts.length !== postData.length) {
|
|
|
|
|
const includedPids = new Set(postData.map(p => p.pid));
|
|
|
|
|
allPosts.reverse().forEach((p, index) => {
|
|
|
|
|
if (!includedPids.has(p.pid) && allPosts[index + 1] && !reverse) {
|
|
|
|
|
allPosts[index + 1].eventEnd = p.eventEnd;
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const result = await plugins.hooks.fire('filter:topic.getPosts', {
|
|
|
|
|
topic: topicData,
|
|
|
|
|
uid: uid,
|
|
|
|
|