From 955a0f1b919c4947ea92bd41ebb7eba4ee5bf949 Mon Sep 17 00:00:00 2001 From: anatawa12 Date: Sat, 5 Aug 2023 19:36:51 +0900 Subject: [PATCH 1/3] chore: add way to show renote in window / tab --- packages/frontend/src/components/MkNote.vue | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/packages/frontend/src/components/MkNote.vue b/packages/frontend/src/components/MkNote.vue index 02431a45571d..a93803ad35ce 100644 --- a/packages/frontend/src/components/MkNote.vue +++ b/packages/frontend/src/components/MkNote.vue @@ -23,10 +23,14 @@
- + + + + + + @@ -166,6 +170,7 @@ import { MenuItem } from '@/types/menu'; import MkRippleEffect from '@/components/MkRippleEffect.vue'; import { showMovedDialog } from '@/scripts/show-moved-dialog'; import { shouldCollapsed } from '@/scripts/collapsed'; +import { notePage } from '@/filters/note'; const props = defineProps<{ note: misskey.entities.Note; From 05f37c7330dadd7e043d78851ba54d1684861304 Mon Sep 17 00:00:00 2001 From: anatawa12 Date: Sat, 5 Aug 2023 20:48:37 +0900 Subject: [PATCH 2/3] feat: report abuse for renote --- locales/index.d.ts | 1 + locales/ja-JP.yml | 1 + packages/frontend/src/components/MkNote.vue | 39 +++++++++++-------- .../frontend/src/scripts/get-note-menu.ts | 30 ++++++++------ 4 files changed, 42 insertions(+), 29 deletions(-) diff --git a/locales/index.d.ts b/locales/index.d.ts index 8efbb6175e35..6272b2eb3e93 100644 --- a/locales/index.d.ts +++ b/locales/index.d.ts @@ -656,6 +656,7 @@ export interface Locale { "sample": string; "abuseReports": string; "reportAbuse": string; + "reportAbuseRenote": string; "reportAbuseOf": string; "fillAbuseReportDescription": string; "abuseReported": string; diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index af7eaad474bb..9070d82a09a9 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -653,6 +653,7 @@ behavior: "動作" sample: "サンプル" abuseReports: "通報" reportAbuse: "通報" +reportAbuseRenote: "Renoteを通報" reportAbuseOf: "{name}を通報する" fillAbuseReportDescription: "通報理由の詳細を記入してください。対象のノートがある場合はそのURLも記入してください。" abuseReported: "内容が送信されました。ご報告ありがとうございました。" diff --git a/packages/frontend/src/components/MkNote.vue b/packages/frontend/src/components/MkNote.vue index a93803ad35ce..0325db4373d8 100644 --- a/packages/frontend/src/components/MkNote.vue +++ b/packages/frontend/src/components/MkNote.vue @@ -24,7 +24,7 @@
- @@ -160,7 +160,7 @@ import { reactionPicker } from '@/scripts/reaction-picker'; import { extractUrlFromMfm } from '@/scripts/extract-url-from-mfm'; import { $i } from '@/account'; import { i18n } from '@/i18n'; -import { getNoteClipMenu, getNoteMenu } from '@/scripts/get-note-menu'; +import { getAbuseNoteMenu, getNoteClipMenu, getNoteMenu } from '@/scripts/get-note-menu'; import { useNoteCapture } from '@/scripts/use-note-capture'; import { deepClone } from '@/scripts/clone'; import { useTooltip } from '@/scripts/use-tooltip'; @@ -423,21 +423,26 @@ async function clip() { } function showRenoteMenu(viaKeyboard = false): void { - if (!isMyRenote) return; - pleaseLogin(); - os.popupMenu([{ - text: i18n.ts.unrenote, - icon: 'ti ti-trash', - danger: true, - action: () => { - os.api('notes/delete', { - noteId: note.id, - }); - isDeleted.value = true; - }, - }], renoteTime.value, { - viaKeyboard: viaKeyboard, - }); + if (isMyRenote) { + pleaseLogin(); + os.popupMenu([{ + text: i18n.ts.unrenote, + icon: 'ti ti-trash', + danger: true, + action: () => { + os.api('notes/delete', { + noteId: note.id, + }); + isDeleted.value = true; + }, + }], renoteTime.value, { + viaKeyboard: viaKeyboard, + }); + } else { + os.popupMenu([getAbuseNoteMenu(note, i18n.ts.reportAbuseRenote)], renoteTime.value, { + viaKeyboard: viaKeyboard, + }); + } } function focus() { diff --git a/packages/frontend/src/scripts/get-note-menu.ts b/packages/frontend/src/scripts/get-note-menu.ts index 960f26ca675b..6b7b4714ef07 100644 --- a/packages/frontend/src/scripts/get-note-menu.ts +++ b/packages/frontend/src/scripts/get-note-menu.ts @@ -86,6 +86,20 @@ export async function getNoteClipMenu(props: { }]; } +export function getAbuseNoteMenu(note: misskey.entities.Note, text: string): MenuItem { + return { + icon: 'ti ti-exclamation-circle', + text, + action: (): void => { + const u = note.url ?? note.uri ?? `${url}/notes/${note.id}`; + os.popup(defineAsyncComponent(() => import('@/components/MkAbuseReportWindow.vue')), { + user: note.user, + initialComment: `Note: ${u}\n-----\n`, + }, {}, 'closed'); + }, + }; +} + export function getNoteMenu(props: { note: misskey.entities.Note; menuButton: Ref; @@ -332,19 +346,11 @@ export function getNoteMenu(props: { }] : [] ),*/ - ...(appearNote.userId !== $i.id ? [ + ...(appearNote.userId !== $i.id || (isRenote && props.note.userId !== $i.id) ? [ null, - { - icon: 'ti ti-exclamation-circle', - text: i18n.ts.reportAbuse, - action: () => { - const u = appearNote.url ?? appearNote.uri ?? `${url}/notes/${appearNote.id}`; - os.popup(defineAsyncComponent(() => import('@/components/MkAbuseReportWindow.vue')), { - user: appearNote.user, - initialComment: `Note: ${u}\n-----\n`, - }, {}, 'closed'); - }, - }] + appearNote.userId !== $i.id ? getAbuseNoteMenu(appearNote, i18n.ts.reportAbuse) : undefined, + isRenote && props.note.userId !== $i.id ? getAbuseNoteMenu(props.note, i18n.ts.reportAbuseRenote) : undefined, + ] : [] ), ...(appearNote.userId === $i.id || $i.isModerator || $i.isAdmin ? [ From b2ee668c343684cc618b48944aaf949eb2500726 Mon Sep 17 00:00:00 2001 From: anatawa12 Date: Sat, 5 Aug 2023 20:53:04 +0900 Subject: [PATCH 3/3] =?UTF-8?q?docs:=20Renote=E8=87=AA=E4=BD=93=E3=82=92?= =?UTF-8?q?=E9=80=9A=E5=A0=B1=E3=81=A7=E3=81=8D=E3=82=8B=E3=82=88=E3=81=86?= =?UTF-8?q?=E3=81=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 183184eccb30..7490f180bdc7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,7 @@ - ハイライトから除外するチャンネルをsensitiveチャンネルのみにしました ### Client +- Enhance: Renote自体を通報できるように ### Server - 通報のメール通知を無効化するオプションを追加