1
0
Fork 0
mirror of https://github.com/M66B/FairEmail.git synced 2025-01-01 04:35:57 +00:00

Small improvement

This commit is contained in:
M66B 2020-04-15 08:42:49 +02:00
parent 358f7214e1
commit 6f7afbd230
2 changed files with 10 additions and 3 deletions

View file

@ -38,6 +38,8 @@ import java.util.List;
import java.util.Locale; import java.util.Locale;
import java.util.Objects; import java.util.Objects;
import javax.mail.Part;
import static androidx.room.ForeignKey.CASCADE; import static androidx.room.ForeignKey.CASCADE;
@Entity( @Entity(
@ -96,9 +98,14 @@ public class EntityAttachment {
public Boolean available = false; public Boolean available = false;
public String error; public String error;
// Gmail sends inline images as attachments with a name and cid
boolean isInline() { boolean isInline() {
// Gmail sends inline images as attachments with a name and cid return (Part.INLINE.equals(disposition) || cid != null);
return (cid != null); }
boolean isAttachment() {
return (Part.ATTACHMENT.equals(disposition) || !TextUtils.isEmpty(name));
} }
boolean isImage() { boolean isImage() {

View file

@ -6362,7 +6362,7 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
Element footer = document.createElement("p"); Element footer = document.createElement("p");
footer.appendElement("br").appendElement("hr"); footer.appendElement("br").appendElement("hr");
for (EntityAttachment attachment : attachments) for (EntityAttachment attachment : attachments)
if (!attachment.isInline()) { if (attachment.isAttachment()) {
hasAttachments = true; hasAttachments = true;
Element strong = document.createElement("strong"); Element strong = document.createElement("strong");
strong.text(getString(R.string.title_attachment)); strong.text(getString(R.string.title_attachment));