Browse Source

Simplify Message ID query

main
M66B 6 years ago
parent
commit
f943303bee
1 changed files with 2 additions and 6 deletions
  1. +2
    -6
      app/src/main/java/eu/faircode/email/DaoMessage.java

+ 2
- 6
app/src/main/java/eu/faircode/email/DaoMessage.java View File

@ -80,12 +80,8 @@ public interface DaoMessage {
@Query("SELECT * FROM message WHERE folder = :folder AND uid = :uid") @Query("SELECT * FROM message WHERE folder = :folder AND uid = :uid")
EntityMessage getMessageByUid(long folder, long uid); EntityMessage getMessageByUid(long folder, long uid);
@Query("SELECT message.* FROM message" +
" JOIN folder ON folder.id = message.folder" +
" WHERE message.account = :account" +
" AND folder.type <> '" + EntityFolder.ARCHIVE + "'" +
" AND msgid = :msgid")
EntityMessage getMessageByMsgId(long account, String msgid);
@Query("SELECT * FROM message WHERE msgid = :msgid")
EntityMessage getMessageByMsgId(String msgid);
@Query("SELECT message.*, folder.name as folderName, folder.type as folderType" + @Query("SELECT message.*, folder.name as folderName, folder.type as folderType" +
", (SELECT COUNT(m.id) FROM message m WHERE m.account = message.account AND m.thread = message.thread AND NOT m.ui_hide) AS count" + ", (SELECT COUNT(m.id) FROM message m WHERE m.account = message.account AND m.thread = message.thread AND NOT m.ui_hide) AS count" +


Loading…
Cancel
Save