diff --git a/lib/fediblock.js b/lib/fediblock.js index 53ac863..0dcd7e9 100644 --- a/lib/fediblock.js +++ b/lib/fediblock.js @@ -33,7 +33,7 @@ module.exports = async (client, apex, app) => { redirect: 'follow' }) setImmediate(() => clearTimeout(timeout)) - return response.json() + return await response.json() } catch (e) { return setImmediate(() => { clearTimeout(timeout) @@ -79,7 +79,7 @@ module.exports = async (client, apex, app) => { } }) app.locals.created++ - return util.sendFederatedMessage(constant.nick, 'New Fediblock Instance', `Fediblock Instance ${instance} with ${json.length} blocks - https://${constant.apexdomain}#${instance}`, getAccount(api)) + return await util.sendFederatedMessage(constant.nick, 'New Fediblock Instance', `Fediblock Instance ${instance} with ${json.length} blocks - https://${constant.apexdomain}#${instance}`, getAccount(api)) } else { const elasticinstance = instancelocated[0]._source.blocks || [] if (Array.isArray(elasticinstance)) { @@ -104,7 +104,7 @@ module.exports = async (client, apex, app) => { if (instancelocated[0]._source.api && instancelocated[0]._source.api.uri && instancelocated[0]._source.api.contact_account && instancelocated[0]._source.api.contact_account.acct) { const difference = blocks.filter(block => block.domain && block.domain.trim().length > 0 && !elasticinstance.some(instance => block.domain === instance.domain)) if (difference.length > 0 && difference.length < 50) { - return util.sendFederatedMessage(constant.nick, 'Detected #Fediblock by Fediblock Instance', `You blocked new instances: ${difference.map(d => d.domain).join(', ')} - https://${constant.apexdomain}#${instance}`, getAccount(instancelocated[0]._source.api)) + return await util.sendFederatedMessage(constant.nick, 'Detected #Fediblock by Fediblock Instance', `You blocked new instances: ${difference.map(d => d.domain).join(', ')} - https://${constant.apexdomain}#${instance}`, getAccount(instancelocated[0]._source.api)) } } } @@ -223,13 +223,13 @@ module.exports = async (client, apex, app) => { console.log('Done: ' + server + ' - ' + i + ' parts with exit ' + exit + '.') } })) - return scanReturn() + return await scanReturn() } else { - return scanReturn() + return await scanReturn() } } catch (e) { // console.error(e) - return scanReturn() + return await scanReturn() } } else { return scanReturn()