diff --git a/app/src/main/java/eu/faircode/email/AdapterMessage.java b/app/src/main/java/eu/faircode/email/AdapterMessage.java index 3c6fa38555..9a410d77d2 100644 --- a/app/src/main/java/eu/faircode/email/AdapterMessage.java +++ b/app/src/main/java/eu/faircode/email/AdapterMessage.java @@ -2187,8 +2187,10 @@ public class AdapterMessage extends RecyclerView.Adapter() { @Override public void onChanged(TupleMessageOperation operation) { - grpDownloading.setVisibility(operation == null || operation.id == null ? View.GONE : View.VISIBLE); - ibDownload.setVisibility(operation != null && operation.id == null && !operation.content ? View.VISIBLE : View.GONE); + grpDownloading.setVisibility(operation != null && + (operation.id != null || operation.uid == null) ? View.VISIBLE : View.GONE); + ibDownload.setVisibility(operation != null && + operation.id == null && operation.uid != null && !operation.content ? View.VISIBLE : View.GONE); } }); diff --git a/app/src/main/java/eu/faircode/email/DaoOperation.java b/app/src/main/java/eu/faircode/email/DaoOperation.java index bc258dbaa8..5702c35b4c 100644 --- a/app/src/main/java/eu/faircode/email/DaoOperation.java +++ b/app/src/main/java/eu/faircode/email/DaoOperation.java @@ -79,7 +79,8 @@ public interface DaoOperation { " ORDER BY " + priority + ", id") LiveData> liveOperations(long account); - @Query("SELECT operation.id, message.content" + + @Query("SELECT operation.id" + + ", message.uid, message.content" + " FROM message" + " LEFT JOIN operation ON operation.message = message.id AND operation.name = :name" + " WHERE message.id = :message") diff --git a/app/src/main/java/eu/faircode/email/TupleMessageOperation.java b/app/src/main/java/eu/faircode/email/TupleMessageOperation.java index 451aafe7cb..243c1fc31b 100644 --- a/app/src/main/java/eu/faircode/email/TupleMessageOperation.java +++ b/app/src/main/java/eu/faircode/email/TupleMessageOperation.java @@ -21,5 +21,6 @@ package eu.faircode.email; public class TupleMessageOperation { public Long id; + public Long uid; public boolean content; }