From 942d5b6672beeabc5b7baf23d470a7ddcd1c4cee Mon Sep 17 00:00:00 2001 From: Namekuji Date: Fri, 14 Apr 2023 10:02:01 -0400 Subject: [PATCH] check movedToUri when receiving a follow request --- packages/backend/src/core/UserFollowingService.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/backend/src/core/UserFollowingService.ts b/packages/backend/src/core/UserFollowingService.ts index addbca8000..df85ec8529 100644 --- a/packages/backend/src/core/UserFollowingService.ts +++ b/packages/backend/src/core/UserFollowingService.ts @@ -145,7 +145,9 @@ export class UserFollowingService implements OnModuleInit { try { await this.apPersonService.updatePerson(oldUri); const oldAccount = await this.apPersonService.resolvePerson(oldUri); - autoAccept = await this.followingsRepository.exist({ + const newUri = this.userEntityService.isRemoteUser(follower) ? follower.uri : `${this.config.url}/users/${follower.id}`; + + autoAccept = oldAccount.movedToUri === newUri && await this.followingsRepository.exist({ where: { followeeId: followee.id, followerId: oldAccount.id,