From 3cd2fc35f05938dbb19d781c73a62697e2e30b95 Mon Sep 17 00:00:00 2001 From: fatchan Date: Sun, 6 Oct 2019 10:12:45 +0000 Subject: [PATCH] cyclic post prune change --- models/forms/makepost.js | 16 ++++++++-------- views/custompages/rules.pug | 7 +++---- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/models/forms/makepost.js b/models/forms/makepost.js index 9434458f..2f83aa7f 100644 --- a/models/forms/makepost.js +++ b/models/forms/makepost.js @@ -408,14 +408,14 @@ module.exports = async (req, res, next) => { }, 0); //reduce amount counted in post by number of posts deleted await Posts.db.updateOne({ - 'postId': data.thread, - 'board': board._id - }, { - '$inc': { //negative increment - 'replyposts': -cyclicOverflowPosts.length, - 'replyfiles': -fileCount - } - }); + 'postId': thread.postId, + 'board': board._id + }, { + '$inc': { //negative increment + 'replyposts': -cyclicOverflowPosts.length, + 'replyfiles': -fileCount + } + }); } } diff --git a/views/custompages/rules.pug b/views/custompages/rules.pug index d915c9e0..cce4f617 100644 --- a/views/custompages/rules.pug +++ b/views/custompages/rules.pug @@ -10,7 +10,6 @@ block content table.table-body tr.table-row td - p Do not post, link or promote any content that violates laws of the United States of America - p Do not spam, flood or perform any actions to an extent that negatively impacts the usual function of the website/server - p SFW marked boards should be primarily safe for work and make ensure that NSFW content is spoilered - + p Do not post, link or promote any content that violates laws of the United States of America. + p Do not spam, flood or perform any actions to an extent that negatively impacts the usual function of the website/server. + p SFW marked boards should have primarily SFW content and ensure that any NSFW content is spoilered.