From 1369a10d4d20fe382df6ac43bb9d5dab74468aa4 Mon Sep 17 00:00:00 2001 From: M66B Date: Sat, 25 Aug 2018 13:59:23 +0000 Subject: [PATCH] Sync newest messages first --- app/src/main/java/eu/faircode/email/ServiceSynchronize.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/ServiceSynchronize.java b/app/src/main/java/eu/faircode/email/ServiceSynchronize.java index b92e1077..528553f4 100644 --- a/app/src/main/java/eu/faircode/email/ServiceSynchronize.java +++ b/app/src/main/java/eu/faircode/email/ServiceSynchronize.java @@ -1216,9 +1216,9 @@ public class ServiceSynchronize extends LifecycleService { int updated = 0; int unchanged = 0; Log.i(Helper.TAG, folder.name + " add=" + imessages.length); - for (Message imessage : imessages) + for (int i = imessages.length - 1; i >= 0; i--) try { - int status = synchronizeMessage(folder, ifolder, (IMAPMessage) imessage); + int status = synchronizeMessage(folder, ifolder, (IMAPMessage) imessages[i]); if (status > 0) added++; else if (status < 0)