From 93230815f51fbeafc8a6e4b623810cd81ba60c2d Mon Sep 17 00:00:00 2001 From: syuilo Date: Fri, 22 Oct 2021 21:01:36 +0900 Subject: [PATCH] =?UTF-8?q?=E3=83=A2=E3=83=87=E3=83=AC=E3=83=BC=E3=82=BF?= =?UTF-8?q?=E3=83=BC=E3=82=92=E3=83=96=E3=83=AD=E3=83=83=E3=82=AF=E3=81=A7?= =?UTF-8?q?=E3=81=8D=E3=81=AA=E3=81=84=E4=BB=95=E6=A7=98=E3=82=92=E5=BB=83?= =?UTF-8?q?=E6=AD=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Resolve #7898 --- CHANGELOG.md | 1 + src/server/api/endpoints/blocking/create.ts | 13 +------------ src/services/blocking/create.ts | 4 ---- 3 files changed, 2 insertions(+), 16 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1a6741184..244ceb382 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -28,6 +28,7 @@ - ActivityPub: not reacted な Undo.Like がinboxに滞留するのを修正 ### Changes +- 連合の考慮に問題があることなどが分かったため、モデレーターをブロックできない仕様を廃止しました - データベースにログを保存しないようになりました - ログを永続化したい場合はsyslogを利用してください diff --git a/src/server/api/endpoints/blocking/create.ts b/src/server/api/endpoints/blocking/create.ts index 4deaa3997..295325239 100644 --- a/src/server/api/endpoints/blocking/create.ts +++ b/src/server/api/endpoints/blocking/create.ts @@ -43,12 +43,6 @@ export const meta = { code: 'ALREADY_BLOCKING', id: '787fed64-acb9-464a-82eb-afbd745b9614' }, - - cannotBlockModerator: { - message: 'Cannot block a moderator or an admin.', - code: 'CANNOT_BLOCK_MODERATOR', - id: '8544aaef-89fb-e470-9f6c-385d38b474f5' - } }, res: { @@ -82,12 +76,7 @@ export default define(meta, async (ps, user) => { throw new ApiError(meta.errors.alreadyBlocking); } - try { - await create(blocker, blockee); - } catch (e) { - if (e.id === 'e42b7890-5e4d-9d9c-d54b-cf4dd30adfb5') throw new ApiError(meta.errors.cannotBlockModerator); - throw e; - } + await create(blocker, blockee); NoteWatchings.delete({ userId: blocker.id, diff --git a/src/services/blocking/create.ts b/src/services/blocking/create.ts index defe37751..6aadc847a 100644 --- a/src/services/blocking/create.ts +++ b/src/services/blocking/create.ts @@ -12,10 +12,6 @@ import { genId } from '@/misc/gen-id'; import { IdentifiableError } from '@/misc/identifiable-error'; export default async function(blocker: User, blockee: User) { - if (blockee.isAdmin || blockee.isModerator) { - throw new IdentifiableError('e42b7890-5e4d-9d9c-d54b-cf4dd30adfb5'); - } - await Promise.all([ cancelRequest(blocker, blockee), cancelRequest(blockee, blocker),