mirror of
https://github.com/M66B/FairEmail.git
synced 2025-02-25 07:23:03 +00:00
Inline attachments required a content ID
This commit is contained in:
parent
23cc120c3a
commit
af5b3ba467
4 changed files with 4 additions and 5 deletions
|
@ -102,7 +102,7 @@ public class AdapterAttachment extends RecyclerView.Adapter<AdapterAttachment.Vi
|
|||
}
|
||||
|
||||
private void bindTo(EntityAttachment attachment) {
|
||||
view.setAlpha(attachment.isInline() ? Helper.LOW_LIGHT : 1.0f);
|
||||
view.setAlpha(attachment.isInline() || TextUtils.isEmpty(attachment.name) ? Helper.LOW_LIGHT : 1.0f);
|
||||
|
||||
ibDelete.setVisibility(readonly ? View.GONE : attachment.isInline() ? View.INVISIBLE : View.VISIBLE);
|
||||
tvName.setText(attachment.name);
|
||||
|
|
|
@ -1104,8 +1104,7 @@ public class AdapterMessage extends RecyclerView.Adapter<AdapterMessage.ViewHold
|
|||
boolean calendar = false;
|
||||
List<EntityAttachment> a = new ArrayList<>();
|
||||
for (EntityAttachment attachment : attachments) {
|
||||
boolean inline = (TextUtils.isEmpty(attachment.name) ||
|
||||
(attachment.isInline() && attachment.isImage()));
|
||||
boolean inline = (attachment.isInline() || TextUtils.isEmpty(attachment.name));
|
||||
if (inline)
|
||||
has_inline = true;
|
||||
if (attachment.progress == null && !attachment.available)
|
||||
|
|
|
@ -91,7 +91,7 @@ public class EntityAttachment {
|
|||
public String error;
|
||||
|
||||
boolean isInline() {
|
||||
return (disposition != null && disposition.equalsIgnoreCase(Part.INLINE));
|
||||
return (disposition != null && disposition.equalsIgnoreCase(Part.INLINE) && cid != null);
|
||||
}
|
||||
|
||||
boolean isImage() {
|
||||
|
|
|
@ -2620,7 +2620,7 @@ public class FragmentCompose extends FragmentBase {
|
|||
}
|
||||
|
||||
for (EntityAttachment attachment : new ArrayList<>(attachments))
|
||||
if (attachment.isInline() && attachment.cid != null && !cids.contains(attachment.cid)) {
|
||||
if (attachment.isInline() && !cids.contains(attachment.cid)) {
|
||||
Log.i("Removing unused inline attachment cid=" + attachment.cid);
|
||||
db.attachment().deleteAttachment(attachment.id);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue