summaryrefslogtreecommitdiffstats
path: root/ui/src/components/mail/view
diff options
context:
space:
mode:
authorManos Pitsidianakis <el13635@mail.ntua.gr>2019-07-31 13:29:55 +0300
committerManos Pitsidianakis <el13635@mail.ntua.gr>2019-08-02 00:22:20 +0300
commitd73069bc8018c3e8a5880a57203c08fa0e765ad6 (patch)
treeed8c000b426da1ae34e869e7de395e51be853842 /ui/src/components/mail/view
parentc17bb24f0dd32fc789bf014434da0d50b0fd69af (diff)
melib: add Other and OctetStream content types
Diffstat (limited to 'ui/src/components/mail/view')
-rw-r--r--ui/src/components/mail/view/envelope.rs16
-rw-r--r--ui/src/components/mail/view/html.rs2
2 files changed, 15 insertions, 3 deletions
diff --git a/ui/src/components/mail/view/envelope.rs b/ui/src/components/mail/view/envelope.rs
index 532f2756..a6c4bbd0 100644
--- a/ui/src/components/mail/view/envelope.rs
+++ b/ui/src/components/mail/view/envelope.rs
@@ -435,11 +435,15 @@ impl Component for EnvelopeView {
));
return true;
}
- ContentType::Unsupported { .. } => {
+ ContentType::Other { ref name, .. } => {
let attachment_type = u.mime_type();
let binary = query_default_app(&attachment_type);
if let Ok(binary) = binary {
- let p = create_temp_file(&decode(u, None), None);
+ let p = create_temp_file(
+ &decode(u, None),
+ name.as_ref().map(|n| n.clone()),
+ None,
+ );
Command::new(&binary)
.arg(p.path())
.stdin(Stdio::piped())
@@ -459,6 +463,14 @@ impl Component for EnvelopeView {
return true;
}
}
+ ContentType::OctetStream { .. } => {
+ context.replies.push_back(UIEvent::StatusEvent(
+ StatusEvent::DisplayMessage(
+ "application/octet-stream isn't supported yet".to_string(),
+ ),
+ ));
+ return true;
+ }
ContentType::PGPSignature => {
context.replies.push_back(UIEvent::StatusEvent(
StatusEvent::DisplayMessage(
diff --git a/ui/src/components/mail/view/html.rs b/ui/src/components/mail/view/html.rs
index 1b80c7ac..076db1ed 100644
--- a/ui/src/components/mail/view/html.rs
+++ b/ui/src/components/mail/view/html.rs
@@ -132,7 +132,7 @@ impl Component for HtmlView {
// scripts)
let binary = query_default_app("text/html");
if let Ok(binary) = binary {
- let p = create_temp_file(&self.bytes, None);
+ let p = create_temp_file(&self.bytes, None, None);
Command::new(&binary)
.arg(p.path())
.stdin(Stdio::piped())