fetch person again (#10514)

This commit is contained in:
Namekuji
2023-04-08 03:13:50 -04:00
committed by GitHub
parent 0f328e8472
commit e23cf77f86
2 changed files with 23 additions and 15 deletions

View File

@@ -736,13 +736,17 @@ export class ApInboxService {
// fetch the new and old accounts
const targetUri = getApHrefNullable(activity.target);
if (!targetUri) return 'skip: invalid activity target';
const new_acc = await this.apPersonService.resolvePerson(targetUri);
const old_acc = await this.apPersonService.resolvePerson(actor.uri);
let new_acc = await this.apPersonService.resolvePerson(targetUri);
let old_acc = await this.apPersonService.resolvePerson(actor.uri);
// update them if they're remote
if (new_acc.uri) await this.apPersonService.updatePerson(new_acc.uri);
if (old_acc.uri) await this.apPersonService.updatePerson(old_acc.uri);
// retrieve updated users
new_acc = await this.apPersonService.resolvePerson(targetUri);
old_acc = await this.apPersonService.resolvePerson(actor.uri);
// check if alsoKnownAs of the new account is valid
let isValidMove = true;
if (old_acc.uri) {