mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 16:46:12 +01:00
replies to posts
This commit is contained in:
@@ -122,8 +122,23 @@ SocketPosts.getReplies = function (socket, pid, callback) {
|
||||
if (!utils.isNumber(pid)) {
|
||||
return callback(new Error('[[error:invalid-data]'));
|
||||
}
|
||||
async.waterfall([
|
||||
function (next) {
|
||||
posts.getPidsFromSet('pid:' + pid + ':replies', 0, -1, false, next);
|
||||
},
|
||||
function (pids, next) {
|
||||
privileges.posts.filter('read', pids, socket.uid, next);
|
||||
},
|
||||
function (pids, next) {
|
||||
posts.getPostsByPids(pids, socket.uid, next);
|
||||
}
|
||||
], function (err, postData) {
|
||||
if (err) {
|
||||
return callback(err);
|
||||
}
|
||||
|
||||
posts.getPostSummariesFromSet('pid:' + pid + ':replies', socket.uid, 0, -1, callback);
|
||||
topics.addPostData(postData, socket.uid, callback);
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user