Skip to content

Node.js based forum software built for the modern web

fix: prefer destructure

Julian Lamc065dd77ebde
diff --git a/src/activitypub/index.js b/src/activitypub/index.js
index ad1e35dd3c..925e24cb3c 100644
--- a/src/activitypub/index.js
+++ b/src/activitypub/index.js
@@ -154,8 +154,7 @@ ActivityPub.resolveInboxes = async (ids) => {
let allowed = false;
try {
const { hostname } = new URL(inbox);
- const result = await ActivityPub.instances.isAllowed(hostname);
- allowed = result.allowed;
+ ({ allowed } = await ActivityPub.instances.isAllowed(hostname));
if (!allowed) {
blocked.push(inbox);
}
@@ -398,8 +397,8 @@ ActivityPub.get = async (type, id, uri, options) => {
}
const { hostname } = new URL(uri);
- const result = await ActivityPub.instances.isAllowed(hostname);
- if (!result.allowed) {
+ const { allowed } = await ActivityPub.instances.isAllowed(hostname);
+ if (!allowed) {
ActivityPub.helpers.log(`[activitypub/get] Not retrieving ${uri}, domain is blocked.`);
const e = new Error(`[[error:activitypub.get-failed]]`);
e.code = `ap_get_domain_blocked`;