melib: ignore Draft body if empty for multipart mail

pull/234/head
Manos Pitsidianakis 4 years ago
parent ad2a51891b
commit 5842a63e37
No known key found for this signature in database
GPG Key ID: 73627C2F690DF710

@ -300,9 +300,11 @@ impl Draft {
} else {
let mut parts = Vec::with_capacity(self.attachments.len() + 1);
let attachments = std::mem::replace(&mut self.attachments, Vec::new());
let mut body_attachment = AttachmentBuilder::default();
body_attachment.set_raw(self.body.as_bytes().to_vec());
parts.push(body_attachment);
if !self.body.is_empty() {
let mut body_attachment = AttachmentBuilder::default();
body_attachment.set_raw(self.body.as_bytes().to_vec());
parts.push(body_attachment);
}
parts.extend(attachments.into_iter());
build_multipart(&mut ret, MultipartType::Mixed, parts);
}

Loading…
Cancel
Save