summaryrefslogtreecommitdiff
path: root/packages/backend/src/misc
diff options
context:
space:
mode:
authorsyuilo <4439005+syuilo@users.noreply.github.com>2024-10-14 17:43:44 +0900
committersyuilo <4439005+syuilo@users.noreply.github.com>2024-10-14 17:43:44 +0900
commit7fd8ef344b33b0a157bc197cbd64069695806936 (patch)
treee8e282ff40f1e81631e89385bb920ca944ee37d5 /packages/backend/src/misc
parent:art: (diff)
downloadmisskey-7fd8ef344b33b0a157bc197cbd64069695806936.tar.gz
misskey-7fd8ef344b33b0a157bc197cbd64069695806936.tar.bz2
misskey-7fd8ef344b33b0a157bc197cbd64069695806936.zip
refactor
Diffstat (limited to 'packages/backend/src/misc')
-rw-r--r--packages/backend/src/misc/is-renote.ts11
1 files changed, 11 insertions, 0 deletions
diff --git a/packages/backend/src/misc/is-renote.ts b/packages/backend/src/misc/is-renote.ts
index 48f821806c..245057c64e 100644
--- a/packages/backend/src/misc/is-renote.ts
+++ b/packages/backend/src/misc/is-renote.ts
@@ -36,6 +36,17 @@ export function isQuote(note: Renote): note is Quote {
note.fileIds.length > 0;
}
+export function isPureRenote(note: MiNote): note is MiNote & { renoteId: MiNote['id']; renote: MiNote } {
+ return (
+ note.renote != null &&
+ note.reply == null &&
+ note.text == null &&
+ note.cw == null &&
+ (note.fileIds == null || note.fileIds.length === 0) &&
+ !note.hasPoll
+ );
+}
+
type PackedRenote =
Packed<'Note'> & {
renoteId: NonNullable<Packed<'Note'>['renoteId']>