From 51a2a7d81c6701cffb5fad76fa8d6305eb95259f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=B4=87=E5=B3=B0=20=E6=9C=94=E8=8F=AF?= Date: Mon, 18 Nov 2024 15:43:36 +0900 Subject: [PATCH] =?UTF-8?q?Add:=20=E3=83=95=E3=83=AD=E3=83=B3=E3=83=88?= =?UTF-8?q?=E3=82=A8=E3=83=B3=E3=83=89=E3=81=AE=E3=83=A6=E3=83=BC=E3=82=B6?= =?UTF-8?q?=E3=83=BC=E3=83=A1=E3=83=8B=E3=83=A5=E3=83=BC=E3=81=AB=E3=83=AA?= =?UTF-8?q?=E3=82=A2=E3=82=AF=E3=82=B7=E3=83=A7=E3=83=B3=E3=83=96=E3=83=AD?= =?UTF-8?q?=E3=83=83=E3=82=AF=E3=82=92=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- locales/index.d.ts | 16 ++++++++++++++++ locales/ja-JP.yml | 4 ++++ packages/frontend/src/scripts/get-user-menu.ts | 14 ++++++++++++++ 3 files changed, 34 insertions(+) diff --git a/locales/index.d.ts b/locales/index.d.ts index 1d2f28d4bc..b52c313208 100644 --- a/locales/index.d.ts +++ b/locales/index.d.ts @@ -606,6 +606,14 @@ export interface Locale extends ILocale { * ブロック解除 */ "unblock": string; + /** + * リアクションをブロック + */ + "blockReactionUser": string; + /** + * リアクションのブロックを解除 + */ + "unblockReactionUser": string; /** * 凍結 */ @@ -622,6 +630,14 @@ export interface Locale extends ILocale { * ブロック解除しますか? */ "unblockConfirm": string; + /** + * リアクションをブロックしますか? + */ + "blockReactionUserConfirm": string; + /** + * リアクションのブロックを解除しますか? + */ + "unblockReactionUserConfirm": string; /** * 凍結しますか? */ diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index 1f1e1b571e..4c48ed3c3d 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -147,10 +147,14 @@ renoteMute: "リノートをミュート" renoteUnmute: "リノートのミュートを解除" block: "ブロック" unblock: "ブロック解除" +blockReactionUser: "リアクションをブロック" +unblockReactionUser: "リアクションのブロックを解除" suspend: "凍結" unsuspend: "解凍" blockConfirm: "ブロックしますか?" unblockConfirm: "ブロック解除しますか?" +blockReactionUserConfirm: "リアクションをブロックしますか?" +unblockReactionUserConfirm: "リアクションのブロックを解除しますか?" suspendConfirm: "凍結しますか?" unsuspendConfirm: "解凍しますか?" selectList: "リストを選択" diff --git a/packages/frontend/src/scripts/get-user-menu.ts b/packages/frontend/src/scripts/get-user-menu.ts index d15279d633..c9039bb927 100644 --- a/packages/frontend/src/scripts/get-user-menu.ts +++ b/packages/frontend/src/scripts/get-user-menu.ts @@ -84,6 +84,16 @@ export function getUserMenu(user: Misskey.entities.UserDetailed, router: IRouter }); } + async function toggleReactionBlock() { + if (!await getConfirmed(user.isReactionBlocking ? i18n.ts.unblockReactionUserConfirm : i18n.ts.blockReactionUserConfirm)) return; + + os.apiWithDialog(user.isReactionBlocking ? 'blocking-reaction-user/delete' : 'blocking-reaction-user/create', { + userId: user.id, + }).then(() => { + user.isReactionBlocking = !user.isReactionBlocking; + }); + } + async function toggleNotify() { os.apiWithDialog('following/update', { userId: user.id, @@ -373,6 +383,10 @@ export function getUserMenu(user: Misskey.entities.UserDetailed, router: IRouter icon: 'ti ti-ban', text: user.isBlocking ? i18n.ts.unblock : i18n.ts.block, action: toggleBlock, + }, { + icon: 'ti ti-ban', + text: user.isReactionBlocking ? i18n.ts.unblockReactionUser : i18n.ts.blockReactionUser, + action: toggleReactionBlock, }); if (user.isFollowed) {