feat: add link to local note in initial comment of abuse note (#13347)

* feat: add link to local note in initial comment of abuse note

* docs(changelog): ノートの通報時にリモートのノートであっても自インスタンスにおけるノートのリンクを含むように
This commit is contained in:
anatawa12 2024-02-17 12:43:39 +09:00 committed by GitHub
parent 9a70ce8f5e
commit fa243276c5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 6 additions and 2 deletions

View file

@ -102,10 +102,13 @@ export function getAbuseNoteMenu(note: Misskey.entities.Note, text: string): Men
icon: 'ti ti-exclamation-circle',
text,
action: (): void => {
const u = note.url ?? note.uri ?? `${url}/notes/${note.id}`;
const localUrl = `${url}/notes/${note.id}`;
let noteInfo = '';
if (note.url ?? note.uri != null) noteInfo = `Note: ${note.url ?? note.uri}\n`;
noteInfo += `Local Note: ${localUrl}\n`;
os.popup(defineAsyncComponent(() => import('@/components/MkAbuseReportWindow.vue')), {
user: note.user,
initialComment: `Note: ${u}\n-----\n`,
initialComment: `${noteInfo}-----\n`,
}, {}, 'closed');
},
};