1
0
Fork 0
mirror of https://github.com/M66B/FairEmail.git synced 2024-12-26 09:47:13 +00:00

Workaround invalid received times

This commit is contained in:
M66B 2020-07-24 13:26:18 +02:00
parent da73632ef8
commit a3501ac0f9

View file

@ -136,6 +136,7 @@ class Core {
private static final int SYNC_BATCH_SIZE = 20;
private static final int DOWNLOAD_BATCH_SIZE = 20;
private static final long YIELD_DURATION = 200L; // milliseconds
private static final long FUTURE_RECEIVED = 30 * 24 * 3600 * 1000L; // milliseconds
private static final int LOCAL_RETRY_MAX = 3;
private static final long LOCAL_RETRY_DELAY = 10 * 1000L; // milliseconds
private static final int TOTAL_RETRY_MAX = LOCAL_RETRY_MAX * 10;
@ -2474,19 +2475,20 @@ class Core {
Long sent = helper.getSent();
Long received;
long future = new Date().getTime() + FUTURE_RECEIVED;
if (account.use_date) {
received = sent;
if (received == null)
if (received == null || received == 0 || received > future)
received = helper.getReceived();
if (received == null)
if (received == null || received == 0 || received > future)
received = helper.getReceivedHeader();
} else if (account.use_received) {
received = helper.getReceivedHeader();
if (received == null)
if (received == null || received == 0 || received > future)
received = helper.getReceived();
} else {
received = helper.getReceived();
if (received == null)
if (received == null || received == 0 || received > future)
received = helper.getReceivedHeader();
}
if (received == null)