mirror of
https://github.com/chatmail/core.git
synced 2026-04-28 19:06:35 +03:00
streamline mimetype guessing and build_body_file
This commit is contained in:
@@ -680,6 +680,7 @@ pub fn guess_msgtype_from_suffix(path: &Path) -> Option<(Viewtype, &str)> {
|
||||
"mp4" => (Viewtype::Video, "video/mp4"),
|
||||
"jpg" => (Viewtype::Image, "image/jpeg"),
|
||||
"jpeg" => (Viewtype::Image, "image/jpeg"),
|
||||
"jpe" => (Viewtype::Image, "image/jpeg"),
|
||||
"png" => (Viewtype::Image, "image/png"),
|
||||
"webp" => (Viewtype::Image, "image/webp"),
|
||||
"gif" => (Viewtype::Gif, "image/gif"),
|
||||
@@ -687,7 +688,6 @@ pub fn guess_msgtype_from_suffix(path: &Path) -> Option<(Viewtype, &str)> {
|
||||
"vcard" => (Viewtype::File, "text/vcard"),
|
||||
};
|
||||
let extension: &str = &path.extension()?.to_str()?.to_lowercase();
|
||||
|
||||
KNOWN.get(extension).map(|x| *x)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user