v1.18.x
barisusakli 10 years ago
parent 39a75ea2d7
commit 57ebcb8b8a

@ -396,9 +396,6 @@ SocketPosts.flag = function(socket, pid, callback) {
post; post;
async.waterfall([ async.waterfall([
function(next) {
posts.flag(pid, next);
},
function(next) { function(next) {
user.getUserFields(socket.uid, ['username', 'reputation'], next); user.getUserFields(socket.uid, ['username', 'reputation'], next);
}, },
@ -407,7 +404,6 @@ SocketPosts.flag = function(socket, pid, callback) {
return next(new Error('[[error:not-enough-reputation-to-flag]]')); return next(new Error('[[error:not-enough-reputation-to-flag]]'));
} }
userName = userData.username; userName = userData.username;
posts.getPostFields(pid, ['tid', 'uid', 'content', 'deleted'], next); posts.getPostFields(pid, ['tid', 'uid', 'content', 'deleted'], next);
}, },
function(postData, next) { function(postData, next) {
@ -415,7 +411,10 @@ SocketPosts.flag = function(socket, pid, callback) {
return next(new Error('[[error:post-deleted]]')); return next(new Error('[[error:post-deleted]]'));
} }
post = postData; post = postData;
topics.getTopicFields(postData.tid, ['title', 'cid'], next); posts.flag(pid, next);
},
function(next) {
topics.getTopicFields(post.tid, ['title', 'cid'], next);
}, },
function(topic, next) { function(topic, next) {
post.topic = topic; post.topic = topic;

Loading…
Cancel
Save