Skip to content
Snippets Groups Projects
Commit 52b75341 authored by Oliver Wiese's avatar Oliver Wiese
Browse files

fix no title in attachment bug

parent 9b71aa59
No related branches found
No related tags found
No related merge requests found
...@@ -652,11 +652,21 @@ class IncomingMail { ...@@ -652,11 +652,21 @@ class IncomingMail {
private func parseUserReadableAttachments(parser: MCOMessageParser, sentEncrypted: Bool = false) -> Set<TempAttachment> { private func parseUserReadableAttachments(parser: MCOMessageParser, sentEncrypted: Bool = false) -> Set<TempAttachment> {
var attachments = Set<TempAttachment>() var attachments = Set<TempAttachment>()
for at in parser.attachments() { for at in parser.attachments() {
if let attachment = at as? MCOAttachment, let mimetype = MIMETYPE.findMIMETYPE(attachment: attachment) { if let attachment = at as? MCOAttachment, let mimetype = MIMETYPE.findMIMETYPE(attachment: attachment), attachment.data.count > 0 {
if (mimetype == .travelUse || mimetype == .travelRepeal) && !sentEncrypted { if (mimetype == .travelUse || mimetype == .travelRepeal) && !sentEncrypted {
continue continue
} }
attachments.insert(TempAttachment(name: attachment.filename, data: attachment.data, mimeType: mimetype)) print(attachment.filename)
print(attachment.data.count)
print(mimetype)
print(attachment.decodedString())
print(attachment.contentID)
print(attachment.description)
var name = "untitled"
if let n = attachment.filename {
name = n
}
attachments.insert(TempAttachment(name: name, data: attachment.data, mimeType: mimetype))
} }
} }
return attachments return attachments
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment