From 7f44041e014583d5406f0d5c2a8b92bb8e444bc8 Mon Sep 17 00:00:00 2001 From: barisusakli Date: Fri, 1 Jul 2016 19:50:24 +0300 Subject: [PATCH] simpler --- src/socket.io/posts/flag.js | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/socket.io/posts/flag.js b/src/socket.io/posts/flag.js index dbb3f7f551..2ad5dcd2b8 100644 --- a/src/socket.io/posts/flag.js +++ b/src/socket.io/posts/flag.js @@ -23,8 +23,8 @@ module.exports = function(SocketPosts) { return callback(new Error('[[error:invalid-data]]')); } - var flaggingUser = {}, - post; + var flaggingUser = {}; + var post; async.waterfall([ function (next) { @@ -40,9 +40,7 @@ module.exports = function(SocketPosts) { }, function (topicData, next) { post.topic = topicData; - next(); - }, - function (next) { + async.parallel({ isAdminOrMod: function(next) { privileges.categories.isAdminOrMod(post.topic.cid, socket.uid, next);