From 3551a3413861467be1e1acfa147aac3e332ea3f2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bar=C4=B1=C5=9F=20Soner=20U=C5=9Fakl=C4=B1?= Date: Tue, 6 Feb 2018 12:54:56 -0500 Subject: [PATCH] up spam be gone --- install/package.json | 2 +- src/topics/create.js | 11 +++++------ 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/install/package.json b/install/package.json index 36d6add398..22585bf839 100644 --- a/install/package.json +++ b/install/package.json @@ -66,7 +66,7 @@ "nodebb-plugin-markdown": "8.3.0", "nodebb-plugin-mentions": "2.2.3", "nodebb-plugin-soundpack-default": "1.0.0", - "nodebb-plugin-spam-be-gone": "0.5.1", + "nodebb-plugin-spam-be-gone": "0.5.2", "nodebb-rewards-essentials": "0.0.11", "nodebb-theme-lavender": "5.0.1", "nodebb-theme-persona": "7.2.20", diff --git a/src/topics/create.js b/src/topics/create.js index bc1091bf52..d8108beb70 100644 --- a/src/topics/create.js +++ b/src/topics/create.js @@ -209,18 +209,17 @@ module.exports = function (Topics) { var uid = data.uid; var content = data.content; var postData; - var cid; async.waterfall([ function (next) { Topics.getTopicField(tid, 'cid', next); }, - function (_cid, next) { - cid = _cid; + function (cid, next) { + data.cid = cid; async.parallel({ topicData: async.apply(Topics.getTopicData, tid), canReply: async.apply(privileges.topics.can, 'topics:reply', tid, uid), - isAdminOrMod: async.apply(privileges.categories.isAdminOrMod, cid, uid), + isAdminOrMod: async.apply(privileges.categories.isAdminOrMod, data.cid, uid), }, next); }, function (results, next) { @@ -243,7 +242,7 @@ module.exports = function (Topics) { guestHandleValid(data, next); }, function (next) { - user.isReadyToPost(uid, cid, next); + user.isReadyToPost(uid, data.cid, next); }, function (next) { plugins.fireHook('filter:topic.reply', data, next); @@ -284,7 +283,7 @@ module.exports = function (Topics) { } Topics.notifyFollowers(postData, uid); - analytics.increment(['posts', 'posts:byCid:' + cid]); + analytics.increment(['posts', 'posts:byCid:' + data.cid]); plugins.fireHook('action:topic.reply', { post: _.clone(postData) }); next(null, postData);