Revert "POP3: fixed hidding incorrect messages"

This reverts commit 30204e3c16.
pull/212/head
M66B 2 years ago
parent 30204e3c16
commit f6faf0fecc

@ -3430,8 +3430,8 @@ class Core {
}
if (account.max_messages != null && !account.leave_on_device) {
int hidden = db.message().setMessagesUiHide(folder.id, Math.abs(account.max_messages) + flagged, reversed);
int deleted = db.message().deleteMessagesKeep(folder.id, Math.abs(account.max_messages) + flagged + 100, reversed);
int hidden = db.message().setMessagesUiHide(folder.id, Math.abs(account.max_messages) + flagged);
int deleted = db.message().deleteMessagesKeep(folder.id, Math.abs(account.max_messages) + flagged + 100);
EntityLog.log(context, account.name + " POP" +
" cleanup max=" + account.max_messages + "" +
" hidden=" + hidden + " deleted=" + deleted);

@ -792,9 +792,9 @@ public interface DaoMessage {
" AND id NOT IN (" +
" SELECT id FROM message" +
" WHERE folder = :folder" +
" ORDER BY CASE WHEN :reversed THEN -received ELSE received END DESC" +
" ORDER BY received DESC" +
" LIMIT :keep)")
int setMessagesUiHide(long folder, int keep, boolean reversed);
int setMessagesUiHide(long folder, int keep);
@Transaction
@Query("UPDATE message SET ui_ignored = :ui_ignored WHERE id = :id AND NOT (ui_ignored IS :ui_ignored)")
@ -1018,7 +1018,7 @@ public interface DaoMessage {
" AND id NOT IN (" +
" SELECT id FROM message" +
" WHERE folder = :folder" +
" ORDER BY CASE WHEN :reversed THEN -received ELSE received END DESC" +
" ORDER BY received DESC" +
" LIMIT :keep)")
int deleteMessagesKeep(long folder, int keep, boolean reversed);
int deleteMessagesKeep(long folder, int keep);
}
Loading…
Cancel
Save