Parse inline attachments from non-DC email clients

Some mobile email clients, such as apple mail, attach or inline images
after description, just like Delta Chat. It is better to display them
instead of ignoring.
This commit is contained in:
Alexander Krotov
2020-04-13 23:10:30 +03:00
committed by holger krekel
parent daf40fde82
commit 1760740a4c

View File

@@ -203,10 +203,6 @@ impl MimeMessage {
/// Delta Chat sends attachments, such as images, in two-part messages, with the first message
/// containing an explanation. If such a message is detected, first part can be safely dropped.
fn squash_attachment_parts(&mut self) {
if !self.has_chat_version() {
return;
}
if let [textpart, filepart] = &self.parts[..] {
let need_drop = {
textpart.typ == Viewtype::Text
@@ -1509,6 +1505,8 @@ MDYyMDYxNTE1RTlDOEE4Cj4+CnN0YXJ0eHJlZgo4Mjc4CiUlRU9GCg==
Some("Mail with inline attachment".to_string())
);
assert_eq!(message.parts.len(), 2);
assert_eq!(message.parts.len(), 1);
assert_eq!(message.parts[0].typ, Viewtype::File);
assert_eq!(message.parts[0].msg, "Hello!");
}
}