From 67dbb2318a29ce847d218b776a415b774c852459 Mon Sep 17 00:00:00 2001 From: Namekuji Date: Sat, 8 Apr 2023 01:44:50 -0400 Subject: [PATCH] fetch person again --- .../backend/src/remote/activitypub/kernel/move/index.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/packages/backend/src/remote/activitypub/kernel/move/index.ts b/packages/backend/src/remote/activitypub/kernel/move/index.ts index 690b84b0e..800fd7bfe 100644 --- a/packages/backend/src/remote/activitypub/kernel/move/index.ts +++ b/packages/backend/src/remote/activitypub/kernel/move/index.ts @@ -19,14 +19,18 @@ export default async ( // fetch the new and old accounts const targetUri = getApHrefNullable(activity.target); if (!targetUri) return "move: target uri is null"; - const new_acc = await resolvePerson(targetUri); + let new_acc = await resolvePerson(targetUri); if (!actor.uri) return "move: actor uri is null"; - const old_acc = await resolvePerson(actor.uri); + let old_acc = await resolvePerson(actor.uri); // update them if they're remote if (new_acc.uri) await updatePerson(new_acc.uri); if (old_acc.uri) await updatePerson(old_acc.uri); + // retrieve updated users + new_acc = await resolvePerson(targetUri); + old_acc = await resolvePerson(actor.uri); + // check if alsoKnownAs of the new account is valid let isValidMove = true; if (old_acc.uri) {