|
|
@ -2460,7 +2460,7 @@ class Core {
|
|
|
|
boolean sync_flagged = prefs.getBoolean("sync_flagged", false);
|
|
|
|
boolean sync_flagged = prefs.getBoolean("sync_flagged", false);
|
|
|
|
boolean sync_kept = prefs.getBoolean("sync_kept", true);
|
|
|
|
boolean sync_kept = prefs.getBoolean("sync_kept", true);
|
|
|
|
boolean delete_unseen = prefs.getBoolean("delete_unseen", false);
|
|
|
|
boolean delete_unseen = prefs.getBoolean("delete_unseen", false);
|
|
|
|
boolean use_modseq = prefs.getBoolean("use_modseq", BuildConfig.DEBUG);
|
|
|
|
boolean use_modseq = prefs.getBoolean("use_modseq", true);
|
|
|
|
boolean perform_expunge = prefs.getBoolean("perform_expunge", true);
|
|
|
|
boolean perform_expunge = prefs.getBoolean("perform_expunge", true);
|
|
|
|
|
|
|
|
|
|
|
|
Log.i(folder.name + " start sync after=" + sync_days + "/" + keep_days +
|
|
|
|
Log.i(folder.name + " start sync after=" + sync_days + "/" + keep_days +
|
|
|
@ -2485,20 +2485,19 @@ class Core {
|
|
|
|
|
|
|
|
|
|
|
|
// https://tools.ietf.org/html/rfc4551
|
|
|
|
// https://tools.ietf.org/html/rfc4551
|
|
|
|
// https://wiki.mozilla.org/Thunderbird:IMAP_RFC_4551_Implementation
|
|
|
|
// https://wiki.mozilla.org/Thunderbird:IMAP_RFC_4551_Implementation
|
|
|
|
|
|
|
|
Long modseq = null;
|
|
|
|
boolean modified = true;
|
|
|
|
boolean modified = true;
|
|
|
|
try {
|
|
|
|
if (use_modseq)
|
|
|
|
if (use_modseq &&
|
|
|
|
try {
|
|
|
|
MessageHelper.hasCapability(ifolder, "CONDSTORE")) {
|
|
|
|
if (MessageHelper.hasCapability(ifolder, "CONDSTORE")) {
|
|
|
|
long modseq = ifolder.getHighestModSeq();
|
|
|
|
modseq = ifolder.getHighestModSeq();
|
|
|
|
Log.i(folder.name + " modseq=" + modseq + "/" + folder.modseq);
|
|
|
|
modified = (force || initialize != 0 ||
|
|
|
|
modified = (force || initialize != 0 ||
|
|
|
|
folder.modseq == null || !folder.modseq.equals(modseq));
|
|
|
|
folder.modseq == null || !folder.modseq.equals(modseq));
|
|
|
|
Log.i(folder.name + " modseq=" + modseq + "/" + folder.modseq + " modified=" + modified);
|
|
|
|
folder.modseq = modseq;
|
|
|
|
}
|
|
|
|
db.folder().setFolderModSeq(folder.id, folder.modseq);
|
|
|
|
} catch (MessagingException ex) {
|
|
|
|
|
|
|
|
Log.w(folder.name, ex);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} catch (MessagingException ex) {
|
|
|
|
|
|
|
|
Log.w(folder.name, ex);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Get reference times
|
|
|
|
// Get reference times
|
|
|
|
Calendar cal_sync = Calendar.getInstance();
|
|
|
|
Calendar cal_sync = Calendar.getInstance();
|
|
|
@ -2906,6 +2905,11 @@ class Core {
|
|
|
|
Log.i(folder.name + " deleted orphans=" + orphans);
|
|
|
|
Log.i(folder.name + " deleted orphans=" + orphans);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Update modseq
|
|
|
|
|
|
|
|
folder.modseq = modseq;
|
|
|
|
|
|
|
|
db.folder().setFolderModSeq(folder.id, folder.modseq);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Update stats
|
|
|
|
int count = MessageHelper.getMessageCount(ifolder);
|
|
|
|
int count = MessageHelper.getMessageCount(ifolder);
|
|
|
|
db.folder().setFolderTotal(folder.id, count < 0 ? null : count);
|
|
|
|
db.folder().setFolderTotal(folder.id, count < 0 ? null : count);
|
|
|
|
account.last_connected = new Date().getTime();
|
|
|
|
account.last_connected = new Date().getTime();
|
|
|
|