diff --git a/src/socket.io/posts.js b/src/socket.io/posts.js index 918c2cd457..2734e330a9 100644 --- a/src/socket.io/posts.js +++ b/src/socket.io/posts.js @@ -159,17 +159,14 @@ SocketPosts.getReplies = function (socket, pid, callback) { }, function (results, next) { postPrivileges = results.privileges; + results.posts.forEach(function (postData, index) { + posts.modifyPostByPrivilege(postData, postPrivileges[index]); + }); results.posts = results.posts.filter(function (postData, index) { return postData && postPrivileges[index].read; }); topics.addPostData(results.posts, socket.uid, next); }, - function (postData, next) { - postData.forEach(function (postData, index) { - posts.modifyPostByPrivilege(postData, postPrivileges[index]); - }); - next(null, postData); - }, ], callback); };