From 0995c36c1ac240fd48f1aa371a561307d091c292 Mon Sep 17 00:00:00 2001 From: tamaina Date: Thu, 20 Apr 2023 20:55:00 +0000 Subject: [PATCH] =?UTF-8?q?newUri=E3=82=92=E5=A4=96=E3=81=AB=E5=87=BA?= =?UTF-8?q?=E3=81=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/backend/src/core/UserFollowingService.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/packages/backend/src/core/UserFollowingService.ts b/packages/backend/src/core/UserFollowingService.ts index 8b5d9fdb1b..5e966f814e 100644 --- a/packages/backend/src/core/UserFollowingService.ts +++ b/packages/backend/src/core/UserFollowingService.ts @@ -151,13 +151,14 @@ export class UserFollowingService implements OnModuleInit { movedFollower = await this.apPersonService.fetchPerson(movedFollower.uri) ?? follower; } + const newUri = this.userEntityService.isLocalUser(movedFollower) ? movedFollower.uri : `${this.config.url}/users/${movedFollower.id}`; + if (movedFollower.alsoKnownAs) { for (const oldUri of movedFollower.alsoKnownAs) { try { let oldAccount = await this.apPersonService.fetchPerson(oldUri); if (!oldAccount) continue; // oldAccountを探してもこのサーバーに存在しない場合はフォロー関係もないということなのでスルー - let newUri: string; if (this.userEntityService.isRemoteUser(movedFollower)) { if ((new Date()).getTime() - (oldAccount.lastFetchedAt?.getTime() ?? 0) > 10 * 1000) { @@ -165,9 +166,6 @@ export class UserFollowingService implements OnModuleInit { } oldAccount = await this.apPersonService.fetchPerson(oldUri) ?? oldAccount; - newUri = movedFollower.uri; - } else { - newUri = `${this.config.url}/users/${movedFollower.id}`; } autoAccept = oldAccount.movedToUri === newUri && await this.followingsRepository.exist({