Merge branch 'develop' into feature/2024.10

This commit is contained in:
dakkar 2024-11-23 10:41:33 +00:00
commit 6c13dc04f2
26 changed files with 849 additions and 366 deletions

View file

@ -71,6 +71,14 @@ type PackedQuote =
fileIds: NonNullable<Packed<'Note'>['fileIds']>
});
type PackedPureRenote = PackedRenote & {
text: NonNullable<Packed<'Note'>['text']>;
cw: NonNullable<Packed<'Note'>['cw']>;
replyId: NonNullable<Packed<'Note'>['replyId']>;
poll: NonNullable<Packed<'Note'>['poll']>;
fileIds: NonNullable<Packed<'Note'>['fileIds']>;
}
export function isRenotePacked(note: Packed<'Note'>): note is PackedRenote {
return note.renoteId != null;
}
@ -82,3 +90,7 @@ export function isQuotePacked(note: PackedRenote): note is PackedQuote {
note.poll != null ||
(note.fileIds != null && note.fileIds.length > 0);
}
export function isPackedPureRenote(note: Packed<'Note'>): note is PackedPureRenote {
return isRenotePacked(note) && !isQuotePacked(note);
}