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