From 5003557e90fd40a9e80bcf188ce6b9efe41f0641 Mon Sep 17 00:00:00 2001 From: Hazelnoot Date: Sun, 14 Sep 2025 10:24:25 -0400 Subject: [PATCH] don't mute users who are already followed --- packages/backend/src/core/AccountMoveService.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/packages/backend/src/core/AccountMoveService.ts b/packages/backend/src/core/AccountMoveService.ts index 87c46ae74b..665798b848 100644 --- a/packages/backend/src/core/AccountMoveService.ts +++ b/packages/backend/src/core/AccountMoveService.ts @@ -201,9 +201,12 @@ export class AccountMoveService { if (oldMutings.length === 0) return; // Check if the destination account is already indefinitely muted by the muter - const existingMutingsMuterUserIds = await this.mutingsRepository.findBy( - { muteeId: dst.id, expiresAt: IsNull() }, - ).then(mutings => mutings.map(muting => muting.muterId)); + const [existingMutingsMuterUserIds, dstFollowers] = await Promise.all([ + this.mutingsRepository.findBy( + { muteeId: dst.id, expiresAt: IsNull() }, + ).then(mutings => mutings.map(muting => muting.muterId)), + this.cacheService.userFollowersCache.fetch(dst.id), + ]); const newMutings: Map = new Map(); @@ -217,6 +220,7 @@ export class AccountMoveService { }; for (const muting of oldMutings) { if (existingMutingsMuterUserIds.includes(muting.muterId)) continue; // skip if already muted indefinitely + if (dstFollowers.has(muting.muterId)) continue; // skip if already following newMutings.set(genId(), { ...muting, muteeId: dst.id,