|
|
|
@ -217,11 +217,15 @@ public interface DaoMessage {
|
|
|
|
|
" WHERE message.account = :account" +
|
|
|
|
|
" AND message.thread = :thread" +
|
|
|
|
|
" AND (:id IS NULL OR message.id = :id)" +
|
|
|
|
|
" AND (NOT :filter_archive OR folder.type <> '" + EntityFolder.ARCHIVE +
|
|
|
|
|
"' OR (SELECT COUNT(m.id) FROM message m" +
|
|
|
|
|
" WHERE m.account = message.account" +
|
|
|
|
|
" AND (NOT :filter_archive" +
|
|
|
|
|
" OR folder.type <> '" + EntityFolder.ARCHIVE + "'" +
|
|
|
|
|
" OR NOT EXISTS" +
|
|
|
|
|
" (SELECT * FROM message m" +
|
|
|
|
|
" WHERE m.id <> message.id" +
|
|
|
|
|
" AND m.account = message.account" +
|
|
|
|
|
" AND m.thread = message.thread" +
|
|
|
|
|
" AND (m.hash = message.hash OR m.msgid = message.msgid)" +
|
|
|
|
|
" AND NOT m.ui_hide) = 1)" +
|
|
|
|
|
" AND NOT m.ui_hide))" +
|
|
|
|
|
" AND (NOT message.ui_hide OR :debug)" +
|
|
|
|
|
" ORDER BY CASE WHEN :ascending THEN message.received ELSE -message.received END" +
|
|
|
|
|
", CASE" +
|
|
|
|
|