From 75b848702462dbf08763b52f72089b5a4bba556d Mon Sep 17 00:00:00 2001 From: Jesse Vincent Date: Mon, 19 Jul 2010 06:13:41 +0000 Subject: [PATCH] First bits of infrastructure for not showing HTML-mail inline images as downloadable attachments --- src/com/fsck/k9/activity/MessageView.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/com/fsck/k9/activity/MessageView.java b/src/com/fsck/k9/activity/MessageView.java index 279e44cfa..b345a2045 100644 --- a/src/com/fsck/k9/activity/MessageView.java +++ b/src/com/fsck/k9/activity/MessageView.java @@ -1803,6 +1803,22 @@ public class MessageView extends K9Activity implements OnClickListener String contentType = MimeUtility.unfoldAndDecode(part.getContentType()); String contentDisposition = MimeUtility.unfoldAndDecode(part.getDisposition()); String name = MimeUtility.getHeaderParameter(contentType, "name"); + + + // Inline parts with a content-id are almost certainly components of an HTML message + // not attachments. Don't show attachment download buttons for them. + // + // TODO: This code won't work until we correct attachment storage + + if ("inline".equalsIgnoreCase(MimeUtility.getHeaderParameter(contentDisposition, null)) + && part.getHeader("Content-Id") != null) + { + return; + } + + + + if (name == null) { name = MimeUtility.getHeaderParameter(contentDisposition, "filename");