From 68b9596a76096a728313d99591b60562d8e8b9fc Mon Sep 17 00:00:00 2001 From: fatchan Date: Sat, 1 Jun 2019 11:53:40 +0000 Subject: [PATCH] show hashtag in capcodes and dont use board name as part of id hash --- models/forms/make-post.js | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/models/forms/make-post.js b/models/forms/make-post.js index f86ad885..9d158c96 100644 --- a/models/forms/make-post.js +++ b/models/forms/make-post.js @@ -169,7 +169,7 @@ module.exports = async (req, res, next, numFiles) => { salt = (await randomBytes(128)).toString('hex'); } if (res.locals.board.settings.ids) { - const fullUserIdHash = crypto.createHash('sha256').update(salt + ip + req.params.board).digest('hex'); + const fullUserIdHash = crypto.createHash('sha256').update(salt + ip).digest('hex'); userId = fullUserIdHash.substring(fullUserIdHash.length-6); } @@ -188,7 +188,7 @@ module.exports = async (req, res, next, numFiles) => { const groups = matches.groups; //name if (groups.name) { - name = groups.name + name = groups.name; } //tripcode if (groups.tripcode) { @@ -197,7 +197,7 @@ module.exports = async (req, res, next, numFiles) => { //capcode if (groups.capcode && hasPerms) { // TODO: add proper code for different capcodes - capcode = groups.capcode; + capcode = `## ${groups.capcode}`; } } } @@ -270,14 +270,6 @@ module.exports = async (req, res, next, numFiles) => { //new thread, rebuild all pages and prunes old threads const prunedThreads = await Posts.pruneOldThreads(req.params.board, res.locals.board.settings.threadLimit); for (let i = 0; i < prunedThreads.length; i++) { - //TODO: consider: - //should i keep these? as an "archive" since they are removed from the DB - //posting wouldnt work and it would just be served as a static file - //files dont matter - //or i could add and set to "archive:true" with the same affect as locking - //but additionally does not appear in board index/catalog but allows to be rebuilt for template updates? - //or is a first party archive kinda against the point of an imageboard? - //i feel like threads epiring and not existing anymore is part of the design parallelPromises.push(remove(`${uploadDirectory}html/${req.params.board}/thread/${prunedThreads[i]}.html`)); } parallelPromises.push(buildBoardMultiple(res.locals.board, 1, 10));