|
|
@ -1985,17 +1985,19 @@ class Core {
|
|
|
|
for (int j = isub.length - 1; j >= 0 && state.isRunning() && state.isRecoverable(); j--)
|
|
|
|
for (int j = isub.length - 1; j >= 0 && state.isRunning() && state.isRecoverable(); j--)
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
// Some providers erroneously return old messages
|
|
|
|
// Some providers erroneously return old messages
|
|
|
|
if (full.contains(isub[j])) {
|
|
|
|
if (full.contains(isub[j]))
|
|
|
|
MessageHelper helper = new MessageHelper((MimeMessage) isub[j], context);
|
|
|
|
try {
|
|
|
|
long received = helper.getReceived();
|
|
|
|
Date received = isub[j].getReceivedDate();
|
|
|
|
boolean unseen = (sync_unseen && !isub[j].isSet(Flags.Flag.SEEN));
|
|
|
|
boolean unseen = (sync_unseen && !isub[j].isSet(Flags.Flag.SEEN));
|
|
|
|
boolean flagged = (sync_flagged && isub[j].isSet(Flags.Flag.FLAGGED));
|
|
|
|
boolean flagged = (sync_flagged && isub[j].isSet(Flags.Flag.FLAGGED));
|
|
|
|
if (received < keep_time && !unseen && !flagged) {
|
|
|
|
if (received != null && received.getTime() < keep_time && !unseen && !flagged) {
|
|
|
|
long uid = ifolder.getUID(isub[j]);
|
|
|
|
long uid = ifolder.getUID(isub[j]);
|
|
|
|
Log.i(folder.name + " Skipping old uid=" + uid + " date=" + received);
|
|
|
|
Log.i(folder.name + " Skipping old uid=" + uid + " date=" + received);
|
|
|
|
ids[from + j] = null;
|
|
|
|
ids[from + j] = null;
|
|
|
|
continue;
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
} catch (Throwable ex) {
|
|
|
|
|
|
|
|
Log.w(ex);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
EntityMessage message = synchronizeMessage(
|
|
|
|
EntityMessage message = synchronizeMessage(
|
|
|
|