diff --git a/app/src/main/java/eu/faircode/email/DaoMessage.java b/app/src/main/java/eu/faircode/email/DaoMessage.java index 8405bcd73b..fb67b35950 100644 --- a/app/src/main/java/eu/faircode/email/DaoMessage.java +++ b/app/src/main/java/eu/faircode/email/DaoMessage.java @@ -78,8 +78,10 @@ public interface DaoMessage { " AND (NOT :found OR message.ui_found = :found)" + " AND message.thread IN" + " (SELECT DISTINCT mm.thread FROM folder ff" + + " JOIN account aa ON aa.id = ff.account" + " JOIN message mm ON mm.folder = ff.id" + - " WHERE ((:found AND mm.ui_found)" + + " WHERE aa.synchronize" + + " AND ((:found AND mm.ui_found)" + " OR (NOT :found AND :type IS NULL AND ff.unified)" + " OR (NOT :found AND :type IS NOT NULL AND ff.type = :type))" + " AND (NOT mm.ui_hide OR :debug))" +