|
|
@ -52,8 +52,8 @@ public interface DaoMessage {
|
|
|
|
", SUM(1 - message.ui_seen) AS unseen" +
|
|
|
|
", SUM(1 - message.ui_seen) AS unseen" +
|
|
|
|
", SUM(1 - message.ui_flagged) AS unflagged" +
|
|
|
|
", SUM(1 - message.ui_flagged) AS unflagged" +
|
|
|
|
", SUM(folder.type = '" + EntityFolder.DRAFTS + "') AS drafts" +
|
|
|
|
", SUM(folder.type = '" + EntityFolder.DRAFTS + "') AS drafts" +
|
|
|
|
", (message.encrypt IN (2, 4)) AS signed" +
|
|
|
|
", (message.ui_encrypt IN (2, 4)) AS signed" +
|
|
|
|
", (message.encrypt IN (1, 3)) AS encrypted" +
|
|
|
|
", (message.ui_encrypt IN (1, 3)) AS encrypted" +
|
|
|
|
", COUNT(DISTINCT CASE WHEN message.msgid IS NULL THEN message.id ELSE message.msgid END) AS visible" +
|
|
|
|
", COUNT(DISTINCT CASE WHEN message.msgid IS NULL THEN message.id ELSE message.msgid END) AS visible" +
|
|
|
|
", SUM(message.total) AS totalSize" +
|
|
|
|
", SUM(message.total) AS totalSize" +
|
|
|
|
", MAX(CASE WHEN" +
|
|
|
|
", MAX(CASE WHEN" +
|
|
|
@ -104,8 +104,8 @@ public interface DaoMessage {
|
|
|
|
", SUM(1 - message.ui_seen) AS unseen" +
|
|
|
|
", SUM(1 - message.ui_seen) AS unseen" +
|
|
|
|
", SUM(1 - message.ui_flagged) AS unflagged" +
|
|
|
|
", SUM(1 - message.ui_flagged) AS unflagged" +
|
|
|
|
", SUM(folder.type = '" + EntityFolder.DRAFTS + "') AS drafts" +
|
|
|
|
", SUM(folder.type = '" + EntityFolder.DRAFTS + "') AS drafts" +
|
|
|
|
", (message.encrypt IN (2, 4)) AS signed" +
|
|
|
|
", (message.ui_encrypt IN (2, 4)) AS signed" +
|
|
|
|
", (message.encrypt IN (1, 3)) AS encrypted" +
|
|
|
|
", (message.ui_encrypt IN (1, 3)) AS encrypted" +
|
|
|
|
", COUNT(DISTINCT CASE WHEN message.msgid IS NULL THEN message.id ELSE message.msgid END) AS visible" +
|
|
|
|
", COUNT(DISTINCT CASE WHEN message.msgid IS NULL THEN message.id ELSE message.msgid END) AS visible" +
|
|
|
|
", SUM(message.total) AS totalSize" +
|
|
|
|
", SUM(message.total) AS totalSize" +
|
|
|
|
", MAX(CASE WHEN folder.id = :folder THEN message.received ELSE 0 END) AS dummy" +
|
|
|
|
", MAX(CASE WHEN folder.id = :folder THEN message.received ELSE 0 END) AS dummy" +
|
|
|
@ -150,8 +150,8 @@ public interface DaoMessage {
|
|
|
|
", CASE WHEN message.ui_seen THEN 0 ELSE 1 END AS unseen" +
|
|
|
|
", CASE WHEN message.ui_seen THEN 0 ELSE 1 END AS unseen" +
|
|
|
|
", CASE WHEN message.ui_flagged THEN 0 ELSE 1 END AS unflagged" +
|
|
|
|
", CASE WHEN message.ui_flagged THEN 0 ELSE 1 END AS unflagged" +
|
|
|
|
", (folder.type = '" + EntityFolder.DRAFTS + "') AS drafts" +
|
|
|
|
", (folder.type = '" + EntityFolder.DRAFTS + "') AS drafts" +
|
|
|
|
", (message.encrypt IN (2, 4)) AS signed" +
|
|
|
|
", (message.ui_encrypt IN (2, 4)) AS signed" +
|
|
|
|
", (message.encrypt IN (1, 3)) AS encrypted" +
|
|
|
|
", (message.ui_encrypt IN (1, 3)) AS encrypted" +
|
|
|
|
", 1 AS visible" +
|
|
|
|
", 1 AS visible" +
|
|
|
|
", message.total AS totalSize" +
|
|
|
|
", message.total AS totalSize" +
|
|
|
|
" FROM message" +
|
|
|
|
" FROM message" +
|
|
|
@ -254,7 +254,7 @@ public interface DaoMessage {
|
|
|
|
" AND (:seen IS NULL OR ui_seen = :seen)" +
|
|
|
|
" AND (:seen IS NULL OR ui_seen = :seen)" +
|
|
|
|
" AND (:flagged IS NULL OR ui_flagged = :flagged)" +
|
|
|
|
" AND (:flagged IS NULL OR ui_flagged = :flagged)" +
|
|
|
|
" AND (:hidden IS NULL OR (CASE WHEN ui_snoozed IS NULL THEN 0 ELSE 1 END) = :hidden)" +
|
|
|
|
" AND (:hidden IS NULL OR (CASE WHEN ui_snoozed IS NULL THEN 0 ELSE 1 END) = :hidden)" +
|
|
|
|
" AND (:encrypted IS NULL OR encrypt > 0)" +
|
|
|
|
" AND (:encrypted IS NULL OR ui_encrypt > 0)" +
|
|
|
|
" ORDER BY received DESC" +
|
|
|
|
" ORDER BY received DESC" +
|
|
|
|
" LIMIT :limit OFFSET :offset")
|
|
|
|
" LIMIT :limit OFFSET :offset")
|
|
|
|
List<TupleMatch> matchMessages(
|
|
|
|
List<TupleMatch> matchMessages(
|
|
|
@ -304,8 +304,8 @@ public interface DaoMessage {
|
|
|
|
", CASE WHEN message.ui_seen THEN 0 ELSE 1 END AS unseen" +
|
|
|
|
", CASE WHEN message.ui_seen THEN 0 ELSE 1 END AS unseen" +
|
|
|
|
", CASE WHEN message.ui_flagged THEN 0 ELSE 1 END AS unflagged" +
|
|
|
|
", CASE WHEN message.ui_flagged THEN 0 ELSE 1 END AS unflagged" +
|
|
|
|
", (folder.type = '" + EntityFolder.DRAFTS + "') AS drafts" +
|
|
|
|
", (folder.type = '" + EntityFolder.DRAFTS + "') AS drafts" +
|
|
|
|
", (message.encrypt IN (2, 4)) AS signed" +
|
|
|
|
", (message.ui_encrypt IN (2, 4)) AS signed" +
|
|
|
|
", (message.encrypt IN (1, 3)) AS encrypted" +
|
|
|
|
", (message.ui_encrypt IN (1, 3)) AS encrypted" +
|
|
|
|
", 1 AS visible" +
|
|
|
|
", 1 AS visible" +
|
|
|
|
", message.total AS totalSize" +
|
|
|
|
", message.total AS totalSize" +
|
|
|
|
" FROM message" +
|
|
|
|
" FROM message" +
|
|
|
@ -349,8 +349,8 @@ public interface DaoMessage {
|
|
|
|
", 1 AS unseen" +
|
|
|
|
", 1 AS unseen" +
|
|
|
|
", 0 AS unflagged" +
|
|
|
|
", 0 AS unflagged" +
|
|
|
|
", 0 AS drafts" +
|
|
|
|
", 0 AS drafts" +
|
|
|
|
", (message.encrypt IN (2, 4)) AS signed" +
|
|
|
|
", (message.ui_encrypt IN (2, 4)) AS signed" +
|
|
|
|
", (message.encrypt IN (1, 3)) AS encrypted" +
|
|
|
|
", (message.ui_encrypt IN (1, 3)) AS encrypted" +
|
|
|
|
", 1 AS visible" +
|
|
|
|
", 1 AS visible" +
|
|
|
|
", message.total AS totalSize" +
|
|
|
|
", message.total AS totalSize" +
|
|
|
|
" FROM message" +
|
|
|
|
" FROM message" +
|
|
|
@ -527,6 +527,9 @@ public interface DaoMessage {
|
|
|
|
@Query("UPDATE message SET encrypt = :encrypt WHERE id = :id")
|
|
|
|
@Query("UPDATE message SET encrypt = :encrypt WHERE id = :id")
|
|
|
|
int setMessageEncrypt(long id, Integer encrypt);
|
|
|
|
int setMessageEncrypt(long id, Integer encrypt);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Query("UPDATE message SET encrypt = :encrypt, ui_encrypt = :encrypt WHERE id = :id")
|
|
|
|
|
|
|
|
int setMessageUiEncrypt(long id, Integer encrypt);
|
|
|
|
|
|
|
|
|
|
|
|
@Query("UPDATE message SET last_attempt = :last_attempt WHERE id = :id")
|
|
|
|
@Query("UPDATE message SET last_attempt = :last_attempt WHERE id = :id")
|
|
|
|
int setMessageLastAttempt(long id, long last_attempt);
|
|
|
|
int setMessageLastAttempt(long id, long last_attempt);
|
|
|
|
|
|
|
|
|
|
|
|