summaryrefslogtreecommitdiff
path: root/packages/backend/src/core/AccountMoveService.ts
diff options
context:
space:
mode:
authorsyuilo <4439005+syuilo@users.noreply.github.com>2024-10-13 20:22:16 +0900
committerGitHub <noreply@github.com>2024-10-13 20:22:16 +0900
commitff47fef5725ba31efc7016534c2d9db8b0ad242a (patch)
tree8cb84a5c3fcccaf6f67d7384a86412e0368d9d99 /packages/backend/src/core/AccountMoveService.ts
parentfeat: ユーザーの名前に禁止ワードを設定できるように (#14... (diff)
downloadsharkey-ff47fef5725ba31efc7016534c2d9db8b0ad242a.tar.gz
sharkey-ff47fef5725ba31efc7016534c2d9db8b0ad242a.tar.bz2
sharkey-ff47fef5725ba31efc7016534c2d9db8b0ad242a.zip
feat: リモートサーバーのサーバー情報を収集しないオプション (#14634)
* wip * wip * Update FetchInstanceMetadataService.ts * Update FetchInstanceMetadataService.ts * Update types.ts
Diffstat (limited to 'packages/backend/src/core/AccountMoveService.ts')
-rw-r--r--packages/backend/src/core/AccountMoveService.ts16
1 files changed, 9 insertions, 7 deletions
diff --git a/packages/backend/src/core/AccountMoveService.ts b/packages/backend/src/core/AccountMoveService.ts
index 6e3125044c..24d11f29ff 100644
--- a/packages/backend/src/core/AccountMoveService.ts
+++ b/packages/backend/src/core/AccountMoveService.ts
@@ -274,13 +274,15 @@ export class AccountMoveService {
}
// Update instance stats by decreasing remote followers count by the number of local followers who were following the old account.
- if (this.userEntityService.isRemoteUser(oldAccount)) {
- this.federatedInstanceService.fetch(oldAccount.host).then(async i => {
- this.instancesRepository.decrement({ id: i.id }, 'followersCount', localFollowerIds.length);
- if (this.meta.enableChartsForFederatedInstances) {
- this.instanceChart.updateFollowers(i.host, false);
- }
- });
+ if (this.meta.enableStatsForFederatedInstances) {
+ if (this.userEntityService.isRemoteUser(oldAccount)) {
+ this.federatedInstanceService.fetchOrRegister(oldAccount.host).then(async i => {
+ this.instancesRepository.decrement({ id: i.id }, 'followersCount', localFollowerIds.length);
+ if (this.meta.enableChartsForFederatedInstances) {
+ this.instanceChart.updateFollowers(i.host, false);
+ }
+ });
+ }
}
// FIXME: expensive?