Use attachment disposition for inline images

This commit is contained in:
M66B
2019-01-06 11:00:08 +00:00
parent ae1a36b482
commit 2be2d10c27
10 changed files with 1314 additions and 38 deletions

View File

@@ -32,6 +32,7 @@ import java.io.OutputStream;
import javax.mail.BodyPart;
import javax.mail.MessagingException;
import javax.mail.Part;
import androidx.annotation.NonNull;
import androidx.room.Entity;
@@ -69,6 +70,7 @@ public class EntityAttachment {
public String name;
@NonNull
public String type;
public String disposition;
public String cid; // Content-ID
public Integer encryption;
public Integer size;
@@ -79,6 +81,10 @@ public class EntityAttachment {
@Ignore
BodyPart part;
boolean isInline() {
return (disposition != null && disposition.equalsIgnoreCase(Part.INLINE));
}
static File getFile(Context context, Long id) {
File dir = new File(context.getFilesDir(), "attachments");
if (!dir.exists())