melib: ignore Draft body if empty for multipart mail
parent
ad2a51891b
commit
5842a63e37
|
@ -300,9 +300,11 @@ impl Draft {
|
||||||
} else {
|
} else {
|
||||||
let mut parts = Vec::with_capacity(self.attachments.len() + 1);
|
let mut parts = Vec::with_capacity(self.attachments.len() + 1);
|
||||||
let attachments = std::mem::replace(&mut self.attachments, Vec::new());
|
let attachments = std::mem::replace(&mut self.attachments, Vec::new());
|
||||||
let mut body_attachment = AttachmentBuilder::default();
|
if !self.body.is_empty() {
|
||||||
body_attachment.set_raw(self.body.as_bytes().to_vec());
|
let mut body_attachment = AttachmentBuilder::default();
|
||||||
parts.push(body_attachment);
|
body_attachment.set_raw(self.body.as_bytes().to_vec());
|
||||||
|
parts.push(body_attachment);
|
||||||
|
}
|
||||||
parts.extend(attachments.into_iter());
|
parts.extend(attachments.into_iter());
|
||||||
build_multipart(&mut ret, MultipartType::Mixed, parts);
|
build_multipart(&mut ret, MultipartType::Mixed, parts);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue