Merge "Quit dropping inline attachments on the floor" into ub-mail-master
This commit is contained in:
commit
da2582c9f4
@ -21,6 +21,7 @@ import android.content.ContentValues;
|
||||
import android.content.Context;
|
||||
import android.database.Cursor;
|
||||
import android.net.Uri;
|
||||
import android.text.TextUtils;
|
||||
|
||||
import com.android.emailcommon.Logging;
|
||||
import com.android.emailcommon.internet.MimeBodyPart;
|
||||
@ -170,6 +171,18 @@ public class LegacyConversions {
|
||||
}
|
||||
}
|
||||
|
||||
public static void updateInlineAttachments(Context context, EmailContent.Message localMessage,
|
||||
ArrayList<Part> inlineAttachments) throws MessagingException, IOException {
|
||||
for (final Part inlinePart : inlineAttachments) {
|
||||
final String disposition = MimeUtility.getHeaderParameter(
|
||||
MimeUtility.unfoldAndDecode(inlinePart.getDisposition()), null);
|
||||
if (!TextUtils.isEmpty(disposition)) {
|
||||
// Treat inline parts as attachments
|
||||
addOneAttachment(context, localMessage, inlinePart);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a single attachment part to the message
|
||||
*
|
||||
|
@ -137,6 +137,7 @@ public class Utilities {
|
||||
&& loadStatus != EmailContent.Message.FLAG_LOADED_UNKNOWN) {
|
||||
// TODO(pwestbro): What should happen with unknown status?
|
||||
LegacyConversions.updateAttachments(context, localMessage, attachments);
|
||||
LegacyConversions.updateInlineAttachments(context, localMessage, viewables);
|
||||
} else {
|
||||
EmailContent.Attachment att = new EmailContent.Attachment();
|
||||
// Since we haven't actually loaded the attachment, we're just putting
|
||||
|
Loading…
Reference in New Issue
Block a user