feat: delete user with replace target

This commit is contained in:
NGPixel
2020-05-30 16:34:09 -04:00
parent 006dae1221
commit 1f9e5b3fd0
15 changed files with 1703 additions and 749 deletions

View File

@@ -10,8 +10,6 @@ const { AkismetClient } = require('akismet-api')
const window = new JSDOM('').window
const DOMPurify = createDOMPurify(window)
md.use(mdEmoji)
let akismetClient = null
// ------------------------------------
@@ -23,6 +21,7 @@ module.exports = {
* Init
*/
async init (config) {
WIKI.logger.info('(COMMENTS/DEFAULT) Initializing...')
if (WIKI.data.commentProvider.config.akismet && WIKI.data.commentProvider.config.akismet.length > 2) {
akismetClient = new AkismetClient({
key: WIKI.data.commentProvider.config.akismet,
@@ -33,14 +32,19 @@ module.exports = {
try {
const isValid = await akismetClient.verifyKey()
if (!isValid) {
WIKI.logger.warn('Akismet Key is invalid!')
akismetClient = null
WIKI.logger.warn('(COMMENTS/DEFAULT) Akismet Key is invalid! [ DISABLED ]')
} else {
WIKI.logger.info('(COMMENTS/DEFAULT) Akismet key is valid. [ OK ]')
}
} catch (err) {
WIKI.logger.warn('Unable to verify Akismet Key: ' + err.message)
akismetClient = null
WIKI.logger.warn('(COMMENTS/DEFAULT) Unable to verify Akismet Key: ' + err.message)
}
} else {
akismetClient = null
}
WIKI.logger.info('(COMMENTS/DEFAULT) Initialization completed.')
},
/**
* Create New Comment
@@ -56,6 +60,8 @@ module.exports = {
}
})
mkdown.use(mdEmoji)
// -> Build New Comment
const newComment = {
content,