diff --git a/packages/frontend/src/components/MkNote.vue b/packages/frontend/src/components/MkNote.vue index 3418676d58..dcf477f74d 100644 --- a/packages/frontend/src/components/MkNote.vue +++ b/packages/frontend/src/components/MkNote.vue @@ -95,7 +95,7 @@ SPDX-License-Identifier: AGPL-3.0-only
- +
diff --git a/packages/frontend/src/utility/get-self-note-ids.ts b/packages/frontend/src/utility/get-self-note-ids.ts new file mode 100644 index 0000000000..b847615a06 --- /dev/null +++ b/packages/frontend/src/utility/get-self-note-ids.ts @@ -0,0 +1,17 @@ +/* + * SPDX-FileCopyrightText: hazelnoot and other Sharkey contributors + * SPDX-License-Identifier: AGPL-3.0-only + */ + +import type * as Misskey from 'misskey-js'; + +/** + * Gets IDs of notes that are visibly the "same" as the current note. + * These are IDs that should not be recursively resolved when starting from the provided note as entry. + */ +export function getSelfNoteIds(note: Misskey.entities.Note): string[] { + const ids = [note.id]; // Regular note + if (note.renote) ids.push(note.renote.id); // Renote or quote + if (note.renote?.renote) ids.push(note.renote.renote.id); // Renote *of* a quote + return ids; +}