From d48d6650a005da0dea96b42403e3075bff02fe97 Mon Sep 17 00:00:00 2001 From: M66B Date: Mon, 12 Apr 2021 12:49:46 +0200 Subject: [PATCH] Unhide messages on quick sync --- app/src/main/java/eu/faircode/email/Core.java | 5 +++-- app/src/main/java/eu/faircode/email/DaoMessage.java | 6 ------ 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/Core.java b/app/src/main/java/eu/faircode/email/Core.java index fbee65f843..28a281306c 100644 --- a/app/src/main/java/eu/faircode/email/Core.java +++ b/app/src/main/java/eu/faircode/email/Core.java @@ -2595,8 +2595,9 @@ class Core { try { for (int i = 0; i < imessages.length && state.isRunning() && state.isRecoverable(); i++) { long uid = ifolder.getUID(imessages[i]); - ids[i] = db.message().getMessageMsgIdByUid(folder.id, uid); - if (ids[i] == null) { + EntityMessage message = db.message().getMessageByUid(folder.id, uid); + ids[i] = (message == null ? null : message.id); + if (message == null || message.ui_hide) { Log.i(folder.name + " missing uid=" + uid); modified = true; break; diff --git a/app/src/main/java/eu/faircode/email/DaoMessage.java b/app/src/main/java/eu/faircode/email/DaoMessage.java index 4d028b045b..706128fe75 100644 --- a/app/src/main/java/eu/faircode/email/DaoMessage.java +++ b/app/src/main/java/eu/faircode/email/DaoMessage.java @@ -296,12 +296,6 @@ public interface DaoMessage { " AND uid = :uid") EntityMessage getMessageByUid(long folder, long uid); - @Query("SELECT id" + - " FROM message" + - " WHERE folder = :folder" + - " AND uid = :uid") - Long getMessageMsgIdByUid(long folder, long uid); - @Query("SELECT id" + " FROM message" + " WHERE folder = :folder" +