Revert "Fixed POP3 cleanup"

This reverts commit 4a17556254.
pull/214/head
M66B 1 year ago
parent 4a17556254
commit 4ec865a658

@ -161,6 +161,7 @@ class Core {
private static final int FIND_RETRY_COUNT = 3; // times
private static final long FIND_RETRY_DELAY = 5 * 1000L; // milliseconds
private static final int POP3_KEEP_EXTRA = 100; // messages
private static final long POP3_KEEP_DELETED = 3 * 24 * 3600 * 1000L; // milliseconds
private static final Map<Long, List<EntityIdentity>> accountIdentities = new HashMap<>();
@ -3645,10 +3646,9 @@ class Core {
}
if (account.max_messages != null && !account.leave_on_device) {
int hidden = db.message().setMessagesUiHide(folder.id,
Math.abs(account.max_messages) + flagged);
int hidden = db.message().setMessagesUiHide(folder.id, Math.abs(account.max_messages));
int deleted = db.message().deleteMessagesKeep(folder.id,
Math.abs(account.max_messages) + flagged + POP3_KEEP_EXTRA);
Math.abs(account.max_messages) + flagged + POP3_KEEP_EXTRA, new Date().getTime() - POP3_KEEP_DELETED);
EntityLog.log(context, account.name + " POP" +
" cleanup max=" + account.max_messages +
" hidden=" + hidden +

@ -1028,7 +1028,8 @@ public interface DaoMessage {
" AND id NOT IN (" +
" SELECT id FROM message" +
" WHERE folder = :folder" +
" AND stored < :before" +
" ORDER BY received DESC" +
" LIMIT :keep)")
int deleteMessagesKeep(long folder, int keep);
int deleteMessagesKeep(long folder, int keep, long before);
}
Loading…
Cancel
Save