trigger side effects also when decting movedTo

This commit is contained in:
Johann150 2023-05-18 02:07:29 +02:00
parent 4d59896cc4
commit 8f0fff5c90
Signed by untrusted user: Johann150
GPG key ID: 9EE6577A2A06F8F1

View file

@ -22,6 +22,7 @@ import { truncate } from '@/misc/truncate.js';
import { StatusError } from '@/misc/fetch.js';
import { uriPersonCache } from '@/services/user-cache.js';
import { publishInternalEvent } from '@/services/stream.js';
import { move } from '@/services/move.js';
import { db } from '@/db/postgre.js';
import { fromHtml } from '@/mfm/from-html.js';
import { Resolver } from '@/remote/activitypub/resolver.js';
@ -342,6 +343,12 @@ export async function updatePerson(value: IObject | string, resolver: Resolver):
const person = await validateActor(object, resolver);
if (person.movedTo != null && exist.movedToId == null) {
// The person was not moved before, but is now. Therefore the person has moved.
// The move was already verified in validateActor.
move(exist.id, person.movedTo.id);
}
apLogger.info(`Updating the Person: ${person.id}`);
// Fetch avatar and banner image