From 330f5b4a332059338bdb55867cc7e713b7af22e4 Mon Sep 17 00:00:00 2001 From: M66B Date: Thu, 4 Jun 2020 18:19:10 +0200 Subject: [PATCH] Prevent crash --- app/src/main/java/eu/faircode/email/DaoMessage.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/DaoMessage.java b/app/src/main/java/eu/faircode/email/DaoMessage.java index 2feaea357b..fcc82ca8dd 100644 --- a/app/src/main/java/eu/faircode/email/DaoMessage.java +++ b/app/src/main/java/eu/faircode/email/DaoMessage.java @@ -43,6 +43,8 @@ public interface DaoMessage { String is_outbox = "folder.type = '" + EntityFolder.OUTBOX + "'"; String is_sent = "folder.type = '" + EntityFolder.SENT + "'"; + @Transaction + @SuppressWarnings(RoomWarnings.CURSOR_MISMATCH) @Query("SELECT message.*" + ", account.pop AS accountProtocol, account.name AS accountName, COALESCE(identity.color, folder.color, account.color) AS accountColor" + ", account.notify AS accountNotify, account.auto_seen AS accountAutoSeen" + @@ -111,7 +113,6 @@ public interface DaoMessage { " ELSE 0" + " END" + ", CASE WHEN :ascending THEN message.received ELSE -message.received END") - @SuppressWarnings(RoomWarnings.CURSOR_MISMATCH) DataSource.Factory pagedUnified( String type, boolean threading, @@ -120,6 +121,8 @@ public interface DaoMessage { boolean found, boolean debug); + @Transaction + @SuppressWarnings(RoomWarnings.CURSOR_MISMATCH) @Query("SELECT message.*" + ", account.pop AS accountProtocol, account.name AS accountName, COALESCE(identity.color, folder.color, account.color) AS accountColor" + ", account.notify AS accountNotify, account.auto_seen AS accountAutoSeen" + @@ -181,7 +184,6 @@ public interface DaoMessage { " ELSE 0" + " END" + ", CASE WHEN :ascending THEN message.received ELSE -message.received END") - @SuppressWarnings(RoomWarnings.CURSOR_MISMATCH) DataSource.Factory pagedFolder( long folder, boolean threading, String sort, boolean ascending, @@ -189,6 +191,7 @@ public interface DaoMessage { boolean found, boolean debug); + @Transaction @Query("SELECT message.*" + ", account.pop AS accountProtocol, account.name AS accountName, COALESCE(identity.color, folder.color, account.color) AS accountColor" + ", account.notify AS accountNotify, account.auto_seen AS accountAutoSeen" +