From c1fc07d2baa8c78cbb3d599a080369704cd564fe Mon Sep 17 00:00:00 2001 From: Sven Sauleau Date: Mon, 20 Feb 2023 17:10:34 +0000 Subject: [PATCH] hotfix: add missing properties for local actors --- backend/src/activitypub/actors/index.ts | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/backend/src/activitypub/actors/index.ts b/backend/src/activitypub/actors/index.ts index 3f5a04d..e88e11d 100644 --- a/backend/src/activitypub/actors/index.ts +++ b/backend/src/activitypub/actors/index.ts @@ -263,8 +263,24 @@ export function personFromRow(row: any): Person { domain = new URL(row.original_actor_id).hostname } - if (properties.inbox === undefined) { - console.warn('malformed Actor: missing inbox') + // Old local actors weren't created with inbox/outbox/etc properties, so add + // them if missing. + { + if (properties.inbox === undefined) { + properties.inbox = id + '/inbox' + } + + if (properties.outbox === undefined) { + properties.outbox = id + '/outbox' + } + + if (properties.following === undefined) { + properties.following = id + '/following' + } + + if (properties.followers === undefined) { + properties.followers = id + '/followers' + } } return {