From 0978aa429ad080eadcf69455bce29cdff525ecad Mon Sep 17 00:00:00 2001 From: kakkokari-gtyih <67428053+kakkokari-gtyih@users.noreply.github.com> Date: Fri, 18 Oct 2024 17:20:16 +0900 Subject: [PATCH] =?UTF-8?q?Revert=20"=E3=82=A4=E3=83=B3=E3=83=9D=E3=83=BC?= =?UTF-8?q?=E3=83=88=E3=81=A7=E9=98=B2=E3=81=92=E3=81=A6=E3=81=AA=E3=81=84?= =?UTF-8?q?=E3=81=AE=E3=82=92=E4=BF=AE=E6=AD=A3"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit d96b2b8e9d2e506129b20c705770b2631be3b715. --- .../processors/ImportBlockingProcessorService.ts | 15 --------------- .../processors/ImportMutingProcessorService.ts | 15 --------------- 2 files changed, 30 deletions(-) diff --git a/packages/backend/src/queue/processors/ImportBlockingProcessorService.ts b/packages/backend/src/queue/processors/ImportBlockingProcessorService.ts index 5441a3129b..b78229c648 100644 --- a/packages/backend/src/queue/processors/ImportBlockingProcessorService.ts +++ b/packages/backend/src/queue/processors/ImportBlockingProcessorService.ts @@ -6,14 +6,12 @@ import { Inject, Injectable } from '@nestjs/common'; import { IsNull } from 'typeorm'; import { DI } from '@/di-symbols.js'; -import type { MiMeta } from '@/models/Meta.js'; import type { UsersRepository, DriveFilesRepository } from '@/models/_.js'; import type Logger from '@/logger.js'; import * as Acct from '@/misc/acct.js'; import { RemoteUserResolveService } from '@/core/RemoteUserResolveService.js'; import { DownloadService } from '@/core/DownloadService.js'; import { UtilityService } from '@/core/UtilityService.js'; -import { RoleService } from '@/core/RoleService.js'; import { bindThis } from '@/decorators.js'; import { QueueService } from '@/core/QueueService.js'; import { QueueLoggerService } from '../QueueLoggerService.js'; @@ -25,16 +23,12 @@ export class ImportBlockingProcessorService { private logger: Logger; constructor( - @Inject(DI.meta) - private serverSettings: MiMeta, - @Inject(DI.usersRepository) private usersRepository: UsersRepository, @Inject(DI.driveFilesRepository) private driveFilesRepository: DriveFilesRepository, - private roleService: RoleService, private queueService: QueueService, private utilityService: UtilityService, private remoteUserResolveService: RemoteUserResolveService, @@ -99,15 +93,6 @@ export class ImportBlockingProcessorService { // skip myself if (target.id === job.data.user.id) return; - // skip if server prohibits blocking - if ( - this.serverSettings.forciblyFollowedUsers.includes(target.id) && - !await this.roleService.isModerator({ id: user.id, isRoot: false }) - ) { - this.logger.warn(`Cannot block due to server policy: ${target.id}`); - return; - } - this.logger.info(`Block ${target.id} ...`); this.queueService.createBlockJob([{ from: { id: user.id }, to: { id: target.id }, silent: true }]); diff --git a/packages/backend/src/queue/processors/ImportMutingProcessorService.ts b/packages/backend/src/queue/processors/ImportMutingProcessorService.ts index 8a89eac439..ec9d2b6c4c 100644 --- a/packages/backend/src/queue/processors/ImportMutingProcessorService.ts +++ b/packages/backend/src/queue/processors/ImportMutingProcessorService.ts @@ -6,7 +6,6 @@ import { Inject, Injectable } from '@nestjs/common'; import { IsNull } from 'typeorm'; import { DI } from '@/di-symbols.js'; -import type { MiMeta } from '@/models/Meta.js'; import type { UsersRepository, DriveFilesRepository } from '@/models/_.js'; import type Logger from '@/logger.js'; import * as Acct from '@/misc/acct.js'; @@ -14,7 +13,6 @@ import { RemoteUserResolveService } from '@/core/RemoteUserResolveService.js'; import { DownloadService } from '@/core/DownloadService.js'; import { UserMutingService } from '@/core/UserMutingService.js'; import { UtilityService } from '@/core/UtilityService.js'; -import { RoleService } from '@/core/RoleService.js'; import { bindThis } from '@/decorators.js'; import { QueueLoggerService } from '../QueueLoggerService.js'; import type * as Bull from 'bullmq'; @@ -25,16 +23,12 @@ export class ImportMutingProcessorService { private logger: Logger; constructor( - @Inject(DI.meta) - private serverSettings: MiMeta, - @Inject(DI.usersRepository) private usersRepository: UsersRepository, @Inject(DI.driveFilesRepository) private driveFilesRepository: DriveFilesRepository, - private roleService: RoleService, private utilityService: UtilityService, private userMutingService: UserMutingService, private remoteUserResolveService: RemoteUserResolveService, @@ -94,15 +88,6 @@ export class ImportMutingProcessorService { // skip myself if (target.id === job.data.user.id) continue; - // skip if server prohibits muting - if ( - this.serverSettings.forciblyFollowedUsers.includes(target.id) && - !await this.roleService.isModerator({ id: user.id, isRoot: false }) - ) { - this.logger.info(`Skip[${linenum}] ${target.id} because of server policy ...`); - continue; - } - this.logger.info(`Mute[${linenum}] ${target.id} ...`); await this.userMutingService.mute(user, target);