From 48438a6b77b9dee68733d95e0c8b86c0e4c2177b Mon Sep 17 00:00:00 2001 From: Thomas Lynch Date: Sat, 7 Aug 2021 02:35:42 +0000 Subject: [PATCH] disable reply subject and forceanon change --- models/forms/makepost.js | 12 ++++-------- views/includes/subjectfield.pug | 2 +- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/models/forms/makepost.js b/models/forms/makepost.js index 98d22d57..9c71d95a 100644 --- a/models/forms/makepost.js +++ b/models/forms/makepost.js @@ -387,12 +387,8 @@ ${res.locals.numFiles > 0 ? req.files.file.map(f => f.name+'|'+(f.phash || '')). salt = (await randomBytesAsync(128)).toString('base64'); } if (ids === true) { -// if (res.locals.country.code === 'TOR') { -// userId = '000000'; -// } else { - const fullUserIdHash = createHash('sha256').update(salt + res.locals.ip.raw).digest('hex'); - userId = fullUserIdHash.substring(fullUserIdHash.length-6); -// } + const fullUserIdHash = createHash('sha256').update(salt + res.locals.ip.raw).digest('hex'); + userId = fullUserIdHash.substring(fullUserIdHash.length-6); } let country = null; if (geoFlags === true) { @@ -417,10 +413,10 @@ ${res.locals.numFiles > 0 ? req.files.file.map(f => f.name+'|'+(f.phash || '')). //spoiler files only if board settings allow const spoiler = (res.locals.permLevel >= 4 || userPostSpoiler) && req.body.spoiler_all ? true : false; - //forceanon hide reply subjects so cant be used as name for replies //forceanon and sageonlyemail only allow sage email - let subject = (res.locals.permLevel >= 4 && req.body.thread && (disableReplySubject || forceAnon)) ? null : req.body.subject; let email = (res.locals.permLevel < 4 || (!forceAnon && !sageOnlyEmail) || req.body.email === 'sage') ? req.body.email : null; + //disablereplysubject + let subject = (res.locals.permLevel >= 4 && req.body.thread && disableReplySubject) ? null : req.body.subject; //get name, trip and cap const { name, tripcode, capcode } = await nameHandler(req.body.name, res.locals.permLevel, diff --git a/views/includes/subjectfield.pug b/views/includes/subjectfield.pug index 7fda9d30..8d683613 100644 --- a/views/includes/subjectfield.pug +++ b/views/includes/subjectfield.pug @@ -1,4 +1,4 @@ -if !isThread || (!board.settings.disableReplySubject && !board.settings.forceAnon) +if !isThread || !board.settings.disableReplySubject section.row .label span Subject