diff --git a/app/src/main/java/eu/faircode/email/DaoMessage.java b/app/src/main/java/eu/faircode/email/DaoMessage.java index ce501398f5..e77fc916f0 100644 --- a/app/src/main/java/eu/faircode/email/DaoMessage.java +++ b/app/src/main/java/eu/faircode/email/DaoMessage.java @@ -334,6 +334,11 @@ public interface DaoMessage { " AND (id = :id OR msgid = :msgid)") List getMessagesBySimilarity(long account, long id, String msgid); + @Query("SELECT * FROM message" + + " WHERE account = :account" + + " AND hash = :hash") + List getMessagesByHash(long account, String hash); + @Query("SELECT COUNT(*) FROM message" + " WHERE folder = :folder" + " AND msgid = :msgid") diff --git a/app/src/main/java/eu/faircode/email/EntityOperation.java b/app/src/main/java/eu/faircode/email/EntityOperation.java index e3e1f87794..0f68555866 100644 --- a/app/src/main/java/eu/faircode/email/EntityOperation.java +++ b/app/src/main/java/eu/faircode/email/EntityOperation.java @@ -299,10 +299,18 @@ public class EntityOperation { return; - } else if (DELETE.equals(name)) + } else if (DELETE.equals(name)) { db.message().setMessageUiHide(message.id, true); - - else if (ATTACHMENT.equals(name)) +/* + if (message.hash != null) { + List sames = db.message().getMessagesByHash(message.account, message.hash); + for (EntityMessage same : sames) { + db.message().setMessageUiHide(same.id, true); + queue(context, same.account, same.folder, same.id, name, jargs); + } + } +*/ + } else if (ATTACHMENT.equals(name)) db.attachment().setProgress(jargs.getLong(0), 0); queue(context, message.account, message.folder, message.id, name, jargs);