mirror of https://github.com/M66B/FairEmail.git
Fixed POP3 cleanup
This commit is contained in:
parent
bd89910485
commit
4a17556254
|
@ -161,7 +161,6 @@ class Core {
|
||||||
private static final int FIND_RETRY_COUNT = 3; // times
|
private static final int FIND_RETRY_COUNT = 3; // times
|
||||||
private static final long FIND_RETRY_DELAY = 5 * 1000L; // milliseconds
|
private static final long FIND_RETRY_DELAY = 5 * 1000L; // milliseconds
|
||||||
private static final int POP3_KEEP_EXTRA = 100; // messages
|
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<>();
|
private static final Map<Long, List<EntityIdentity>> accountIdentities = new HashMap<>();
|
||||||
|
|
||||||
|
@ -3646,9 +3645,10 @@ class Core {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (account.max_messages != null && !account.leave_on_device) {
|
if (account.max_messages != null && !account.leave_on_device) {
|
||||||
int hidden = db.message().setMessagesUiHide(folder.id, Math.abs(account.max_messages));
|
int hidden = db.message().setMessagesUiHide(folder.id,
|
||||||
|
Math.abs(account.max_messages) + flagged);
|
||||||
int deleted = db.message().deleteMessagesKeep(folder.id,
|
int deleted = db.message().deleteMessagesKeep(folder.id,
|
||||||
Math.abs(account.max_messages) + flagged + POP3_KEEP_EXTRA, new Date().getTime() - POP3_KEEP_DELETED);
|
Math.abs(account.max_messages) + flagged + POP3_KEEP_EXTRA);
|
||||||
EntityLog.log(context, account.name + " POP" +
|
EntityLog.log(context, account.name + " POP" +
|
||||||
" cleanup max=" + account.max_messages +
|
" cleanup max=" + account.max_messages +
|
||||||
" hidden=" + hidden +
|
" hidden=" + hidden +
|
||||||
|
|
|
@ -1028,8 +1028,7 @@ public interface DaoMessage {
|
||||||
" AND id NOT IN (" +
|
" AND id NOT IN (" +
|
||||||
" SELECT id FROM message" +
|
" SELECT id FROM message" +
|
||||||
" WHERE folder = :folder" +
|
" WHERE folder = :folder" +
|
||||||
" AND stored < :before" +
|
|
||||||
" ORDER BY received DESC" +
|
" ORDER BY received DESC" +
|
||||||
" LIMIT :keep)")
|
" LIMIT :keep)")
|
||||||
int deleteMessagesKeep(long folder, int keep, long before);
|
int deleteMessagesKeep(long folder, int keep);
|
||||||
}
|
}
|
Loading…
Reference in New Issue