feat: report abuse for renote
This commit is contained in:
parent
d857801e03
commit
e949b53f91
1
locales/index.d.ts
vendored
1
locales/index.d.ts
vendored
|
@ -657,6 +657,7 @@ export interface Locale {
|
||||||
"sample": string;
|
"sample": string;
|
||||||
"abuseReports": string;
|
"abuseReports": string;
|
||||||
"reportAbuse": string;
|
"reportAbuse": string;
|
||||||
|
"reportAbuseRenote": string;
|
||||||
"reportAbuseOf": string;
|
"reportAbuseOf": string;
|
||||||
"fillAbuseReportDescription": string;
|
"fillAbuseReportDescription": string;
|
||||||
"abuseReported": string;
|
"abuseReported": string;
|
||||||
|
|
|
@ -654,6 +654,7 @@ behavior: "動作"
|
||||||
sample: "サンプル"
|
sample: "サンプル"
|
||||||
abuseReports: "通報"
|
abuseReports: "通報"
|
||||||
reportAbuse: "通報"
|
reportAbuse: "通報"
|
||||||
|
reportAbuseRenote: "Renoteを通報"
|
||||||
reportAbuseOf: "{name}を通報する"
|
reportAbuseOf: "{name}を通報する"
|
||||||
fillAbuseReportDescription: "通報理由の詳細を記入してください。対象のノートがある場合はそのURLも記入してください。"
|
fillAbuseReportDescription: "通報理由の詳細を記入してください。対象のノートがある場合はそのURLも記入してください。"
|
||||||
abuseReported: "内容が送信されました。ご報告ありがとうございました。"
|
abuseReported: "内容が送信されました。ご報告ありがとうございました。"
|
||||||
|
|
|
@ -29,7 +29,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||||
</I18n>
|
</I18n>
|
||||||
<div :class="$style.renoteInfo">
|
<div :class="$style.renoteInfo">
|
||||||
<span :class="$style.renoteTime">
|
<span :class="$style.renoteTime">
|
||||||
<button v-if="isMyRenote" ref="renoteTime" class="_button">
|
<button ref="renoteTime" class="_button">
|
||||||
<i class="ti ti-dots" :class="$style.renoteMenu" @click="showRenoteMenu()"></i>
|
<i class="ti ti-dots" :class="$style.renoteMenu" @click="showRenoteMenu()"></i>
|
||||||
</button>
|
</button>
|
||||||
<MkA :to="notePage(note)">
|
<MkA :to="notePage(note)">
|
||||||
|
@ -165,7 +165,7 @@ import { reactionPicker } from '@/scripts/reaction-picker';
|
||||||
import { extractUrlFromMfm } from '@/scripts/extract-url-from-mfm';
|
import { extractUrlFromMfm } from '@/scripts/extract-url-from-mfm';
|
||||||
import { $i } from '@/account';
|
import { $i } from '@/account';
|
||||||
import { i18n } from '@/i18n';
|
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 { useNoteCapture } from '@/scripts/use-note-capture';
|
||||||
import { deepClone } from '@/scripts/clone';
|
import { deepClone } from '@/scripts/clone';
|
||||||
import { useTooltip } from '@/scripts/use-tooltip';
|
import { useTooltip } from '@/scripts/use-tooltip';
|
||||||
|
@ -430,21 +430,26 @@ async function clip() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function showRenoteMenu(viaKeyboard = false): void {
|
function showRenoteMenu(viaKeyboard = false): void {
|
||||||
if (!isMyRenote) return;
|
if (isMyRenote) {
|
||||||
pleaseLogin();
|
pleaseLogin();
|
||||||
os.popupMenu([{
|
os.popupMenu([{
|
||||||
text: i18n.ts.unrenote,
|
text: i18n.ts.unrenote,
|
||||||
icon: 'ti ti-trash',
|
icon: 'ti ti-trash',
|
||||||
danger: true,
|
danger: true,
|
||||||
action: () => {
|
action: () => {
|
||||||
os.api('notes/delete', {
|
os.api('notes/delete', {
|
||||||
noteId: note.id,
|
noteId: note.id,
|
||||||
});
|
});
|
||||||
isDeleted.value = true;
|
isDeleted.value = true;
|
||||||
},
|
},
|
||||||
}], renoteTime.value, {
|
}], renoteTime.value, {
|
||||||
viaKeyboard: viaKeyboard,
|
viaKeyboard: viaKeyboard,
|
||||||
});
|
});
|
||||||
|
} else {
|
||||||
|
os.popupMenu([getAbuseNoteMenu(note, i18n.ts.reportAbuseRenote)], renoteTime.value, {
|
||||||
|
viaKeyboard: viaKeyboard,
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function focus() {
|
function focus() {
|
||||||
|
|
|
@ -92,6 +92,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: {
|
export function getNoteMenu(props: {
|
||||||
note: misskey.entities.Note;
|
note: misskey.entities.Note;
|
||||||
menuButton: Ref<HTMLElement>;
|
menuButton: Ref<HTMLElement>;
|
||||||
|
@ -342,19 +356,11 @@ export function getNoteMenu(props: {
|
||||||
}]
|
}]
|
||||||
: []
|
: []
|
||||||
),*/
|
),*/
|
||||||
...(appearNote.userId !== $i.id ? [
|
...(appearNote.userId !== $i.id || (isRenote && props.note.userId !== $i.id) ? [
|
||||||
null,
|
null,
|
||||||
{
|
appearNote.userId !== $i.id ? getAbuseNoteMenu(appearNote, i18n.ts.reportAbuse) : undefined,
|
||||||
icon: 'ti ti-exclamation-circle',
|
isRenote && props.note.userId !== $i.id ? getAbuseNoteMenu(props.note, i18n.ts.reportAbuseRenote) : undefined,
|
||||||
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 || $i.isModerator || $i.isAdmin ? [
|
...(appearNote.userId === $i.id || $i.isModerator || $i.isAdmin ? [
|
||||||
|
|
Loading…
Reference in a new issue