diff options
| author | Hazelnoot <acomputerdog@gmail.com> | 2025-05-20 21:21:42 -0400 |
|---|---|---|
| committer | Hazelnoot <acomputerdog@gmail.com> | 2025-05-20 21:21:42 -0400 |
| commit | 38d4a7fd56fe8fb9b027e16f27e907c865a9c754 (patch) | |
| tree | b93774d2a14b4aec864348030fc94d95b03bd094 /packages/frontend/src/utility | |
| parent | merge: Fix "fetch linked note" button for AP previews (!1037) (diff) | |
| download | sharkey-38d4a7fd56fe8fb9b027e16f27e907c865a9c754.tar.gz sharkey-38d4a7fd56fe8fb9b027e16f27e907c865a9c754.tar.bz2 sharkey-38d4a7fd56fe8fb9b027e16f27e907c865a9c754.zip | |
don't recursively render note previews
Diffstat (limited to 'packages/frontend/src/utility')
| -rw-r--r-- | packages/frontend/src/utility/get-self-note-ids.ts | 17 |
1 files changed, 17 insertions, 0 deletions
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; +} |