MCPcopy Create free account
hub / github.com/chatmail/core / has_file

Method has_file

src/message.rs:2321–2336  ·  view source on GitHub ↗

Whether a message with this [`Viewtype`] should have a file attachment.

(&self)

Source from the content-addressed store, hash-verified

2319impl Viewtype {
2320 /// Whether a message with this [`Viewtype`] should have a file attachment.
2321 pub fn has_file(&self) -> bool {
2322 match self {
2323 Viewtype::Unknown => false,
2324 Viewtype::Text => false,
2325 Viewtype::Image => true,
2326 Viewtype::Gif => true,
2327 Viewtype::Sticker => true,
2328 Viewtype::Audio => true,
2329 Viewtype::Voice => true,
2330 Viewtype::Video => true,
2331 Viewtype::File => true,
2332 Viewtype::Call => false,
2333 Viewtype::Webxdc => true,
2334 Viewtype::Vcard => true,
2335 }
2336 }
2337}
2338
2339#[cfg(test)]

Callers 6

render_messageMethod · 0.80
handle_post_messageFunction · 0.80
prepare_msg_blobFunction · 0.80
from_msgMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected