summaryrefslogtreecommitdiffstats
path: root/ui/src
diff options
context:
space:
mode:
authorManos Pitsidianakis <el13635@mail.ntua.gr>2019-12-06 16:34:31 +0200
committerManos Pitsidianakis <el13635@mail.ntua.gr>2019-12-06 16:37:44 +0200
commitd048d8566d63c09736b94edf6044fcf9db96bf20 (patch)
tree27ab23ea1888b09fa521af6a5b0cda40069242c9 /ui/src
parentc431fb6dff518b1f23da013bea5ee0bf627261e9 (diff)
ui: add format=flowed if text/plain att is the only one
Diffstat (limited to 'ui/src')
-rw-r--r--ui/src/components/mail/compose.rs18
1 files changed, 18 insertions, 0 deletions
diff --git a/ui/src/components/mail/compose.rs b/ui/src/components/mail/compose.rs
index 25c136fc..66f278b0 100644
--- a/ui/src/components/mail/compose.rs
+++ b/ui/src/components/mail/compose.rs
@@ -1153,6 +1153,24 @@ pub fn send_draft(
return false;
}
draft.attachments.push(output.unwrap());
+ } else {
+ let mut content_type = ContentType::default();
+ if format_flowed {
+ if let ContentType::Text {
+ ref mut parameters, ..
+ } = content_type
+ {
+ parameters.push((b"format".to_vec(), b"flowed".to_vec()));
+ }
+
+ let body: AttachmentBuilder = Attachment::new(
+ content_type,
+ Default::default(),
+ std::mem::replace(&mut draft.body, String::new()).into_bytes(),
+ )
+ .into();
+ draft.attachments.insert(0, body);
+ }
}
bytes = draft.finalise().unwrap();
stdin