hippofish/packages/backend-rs/src/misc/is_quote.rs
2024-05-20 19:23:54 +09:00

10 lines
285 B
Rust

use crate::model::entity::note;
// for napi export
// https://github.com/napi-rs/napi-rs/issues/2060
type Note = note::Model;
#[crate::export]
pub fn is_quote(note: Note) -> bool {
note.renote_id.is_some() && (note.text.is_some() || note.has_poll || !note.file_ids.is_empty())
}