hippofish/packages/backend/src/misc/is-pure-renote.ts
anatawa12 7015cc937b
fix(backend): We can renote pure renote (#12171)
* chore: make pure renote detection an function

* fix: we can renote pure renote

* docs(changelog): リノートをリノートできるのを修正

* fix: remaining debug log

* chore: move isPureRenote to misc

* chore: make isPureRenote type guard

* chore: use isPureRenote in other places

* fix CHANGELOG

* style: fix lint

---------

Co-authored-by: syuilo <Syuilotan@yahoo.co.jp>
2023-10-30 13:48:22 +09:00

10 lines
395 B
TypeScript

import type { MiNote } from '@/models/Note.js';
export function isPureRenote(note: MiNote): note is MiNote & { renoteId: NonNullable<MiNote['renoteId']> } {
if (!note.renoteId) return false;
if (note.text) return false; // it's quoted with text
if (note.fileIds.length !== 0) return false; // it's quoted with files
if (note.hasPoll) return false; // it's quoted with poll
return true;
}