indent & spacing adjustments

indiachan-spamvector
Thomas Lynch 1 year ago
parent c6d646ce8d
commit f4f88d697a
Signed by: fatchan
GPG Key ID: A7E5E8B7E11EE92D
  1. 9
      lib/file/video/videothumbnail.js
  2. 6
      lib/misc/dotwofactor.js
  3. 4
      lib/misc/dynamic.js
  4. 6
      lib/post/deletequotes.js

@ -16,10 +16,11 @@ module.exports = (file, geometry, timestamp) => {
});
if (timestamp === 0) {
//bypass issue with some dumb files like audio album art covert not working with .screenshots
command.inputOptions([
'-t',
0
])
command
.inputOptions([
'-t',
0
])
.outputOptions([
`-vf scale=${geometry.width > geometry.height ? thumbSize + ':-2' : '-2:' + thumbSize}`,
'-frames:v 1'

@ -2,18 +2,22 @@ const OTPAuth = require('otpauth')
, redis = require(__dirname+'/../redis/redis.js');
module.exports = async (username, totpSecret, userInput) => {
if (!userInput) {
return null;
}
const totp = new OTPAuth.TOTP({
secret: totpSecret,
algorithm: 'SHA256',
});
let delta = totp.validate({
token: userInput,
algorithm: 'SHA256',
window: 1,
});
if (delta !== null) {
const key = `twofactor_success:${username}:${userInput}`;
const uses = await redis.incr(key);
@ -22,5 +26,7 @@ module.exports = async (username, totpSecret, userInput) => {
return null;
}
}
return delta;
};

@ -1,14 +1,18 @@
'use strict';
module.exports = (req, res, code, page, data) => {
res.status(code);
if (req.body.minimal) {
data.minimal = true;
}
if (req.headers && req.headers['x-using-xhr'] != null) {
//if sending header with js, and not a bypass_minimal page, show modal
return res.json(data);
} else {
return res.render(page, data);
}
};

@ -8,8 +8,10 @@ module.exports = (deletedPosts, updateQuotePosts) => {
const quotesBefore = post.quotes.length;
post.quotes = post.quotes.filter(q => q.postId !== ap.postId);
if (quotesBefore !== post.quotes.length) { //optimization, probably
post.message = post.message.replace(`<a class="quote" href="/${ap.board}/thread/${ap.thread}.html#${ap.postId}">&gt;&gt;${ap.postId}</a>`,
`<span class="invalid-quote">&gt;&gt;${ap.postId}</span>`);
post.message = post.message.replace(
`<a class="quote" href="/${ap.board}/thread/${ap.thread}.html#${ap.postId}">&gt;&gt;${ap.postId}</a>`,
`<span class="invalid-quote">&gt;&gt;${ap.postId}</span>`
);
}
});
bulkWrites.push({

Loading…
Cancel
Save