Get attachment mimetype

This commit is contained in:
M66B 2020-10-27 18:38:23 +01:00
parent 4faf5ad9bc
commit 3b8574b2ca
2 changed files with 4 additions and 4 deletions

View File

@ -1540,7 +1540,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
if (attachment.available)
if (attachment.isInline() && attachment.isImage())
inlineImages++;
else if ("message/rfc822".equals(attachment.type))
else if ("message/rfc822".equals(attachment.getMimeType()))
embeddedMessages++;
int lastInlineImages = 0;
@ -1551,7 +1551,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
if (attachment.available)
if (attachment.isInline() && attachment.isImage())
lastInlineImages++;
else if ("message/rfc822".equals(attachment.type))
else if ("message/rfc822".equals(attachment.getMimeType()))
lastEmbeddedMessages++;
boolean show_images = properties.getValue("images", message.id);
@ -2062,7 +2062,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
// Add embedded messages
for (EntityAttachment attachment : attachments)
if (attachment.available && "message/rfc822".equals(attachment.type))
if (attachment.available && "message/rfc822".equals(attachment.getMimeType()))
try (FileInputStream fis = new FileInputStream(attachment.getFile(context))) {
Properties props = MessageHelper.getSessionProperties();
Session isession = Session.getInstance(props, null);

View File

@ -214,7 +214,7 @@ public class EntityRule {
boolean found = false;
for (EntityAttachment attachment : attachments)
if (mimeType.equalsIgnoreCase(attachment.type)) {
if (mimeType.equalsIgnoreCase(attachment.getMimeType())) {
found = true;
break;
}