Quick sync improvements

This commit is contained in:
M66B 2021-08-06 17:53:52 +02:00
parent 7357625838
commit 8dcded4a11
1 changed files with 9 additions and 8 deletions

View File

@ -2743,8 +2743,9 @@ class Core {
Log.i(folder.name + " remote count=" + imessages.length + " search=" + stats.search_ms + " ms");
ids = new Long[imessages.length];
if (!modified && !(sync_quick_imap && !force)) {
Log.i(folder.name + " quick check count=" + imessages.length);
if (!modified) {
Log.i(folder.name + " quick check");
long fetch = SystemClock.elapsedRealtime();
FetchProfile fp = new FetchProfile();
@ -3077,6 +3078,12 @@ class Core {
}
}
}
// Delete not synchronized messages without uid
if (!EntityFolder.isOutgoing(folder.type)) {
int orphans = db.message().deleteOrphans(folder.id, new Date().getTime());
Log.i(folder.name + " deleted orphans=" + orphans);
}
} else {
List<Message> _imessages = new ArrayList<>();
List<Long> _ids = new ArrayList<>();
@ -3100,12 +3107,6 @@ class Core {
ids = _ids.toArray(new Long[0]);
}
// Delete not synchronized messages without uid
if (!EntityFolder.isOutgoing(folder.type)) {
int orphans = db.message().deleteOrphans(folder.id, new Date().getTime());
Log.i(folder.name + " deleted orphans=" + orphans);
}
// Update modseq
folder.modseq = modseq;
db.folder().setFolderModSeq(folder.id, folder.modseq);