mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-05 05:25:49 +01:00
removed privileges.posts.get from addPostData
privilege data is already available higher up
This commit is contained in:
@@ -15,12 +15,12 @@ module.exports = function(SocketTopics) {
|
||||
}
|
||||
|
||||
async.parallel({
|
||||
settings: function(next) {
|
||||
user.getSettings(socket.uid, next);
|
||||
},
|
||||
privileges: function(next) {
|
||||
privileges.topics.get(data.tid, socket.uid, next);
|
||||
},
|
||||
settings: function(next) {
|
||||
user.getSettings(socket.uid, next);
|
||||
},
|
||||
topic: function(next) {
|
||||
topics.getTopicFields(data.tid, ['postcount', 'deleted'], next);
|
||||
}
|
||||
@@ -78,12 +78,15 @@ module.exports = function(SocketTopics) {
|
||||
'downvote:disabled': function(next) {
|
||||
next(null, parseInt(meta.config['downvote:disabled'], 10) === 1);
|
||||
}
|
||||
}, function(err, results) {
|
||||
if (results.mainPost) {
|
||||
results.posts = [results.mainPost].concat(results.posts);
|
||||
}, function(err, topicData) {
|
||||
if (err) {
|
||||
return callback(err);
|
||||
}
|
||||
|
||||
callback(err, results);
|
||||
if (topicData.mainPost) {
|
||||
topicData.posts = [topicData.mainPost].concat(topicData.posts);
|
||||
}
|
||||
topics.modifyByPrivilege(topicData.posts, results.privileges);
|
||||
callback(null, topicData);
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user