From f7299a69d44efbc36d864a0096d1f741d2a797d6 Mon Sep 17 00:00:00 2001 From: cketti Date: Fri, 17 Feb 2012 00:43:35 +0100 Subject: [PATCH] Keep track of UIDs when moving messages to the trash folder --- src/com/fsck/k9/controller/MessagingController.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/com/fsck/k9/controller/MessagingController.java b/src/com/fsck/k9/controller/MessagingController.java index 06fb59370..cc09d8e31 100644 --- a/src/com/fsck/k9/controller/MessagingController.java +++ b/src/com/fsck/k9/controller/MessagingController.java @@ -3515,6 +3515,7 @@ public class MessagingController implements Runnable { } Store localStore = account.getLocalStore(); localFolder = localStore.getFolder(folder); + Map uidMap = null; if (folder.equals(account.getTrashFolderName()) || K9.FOLDER_NONE.equals(account.getTrashFolderName())) { if (K9.DEBUG) Log.d(K9.LOG_TAG, "Deleting messages in trash folder or trash set to -None-, not copying"); @@ -3529,7 +3530,7 @@ public class MessagingController implements Runnable { if (K9.DEBUG) Log.d(K9.LOG_TAG, "Deleting messages in normal folder, moving"); - localFolder.moveMessages(messages, localTrashFolder); + uidMap = localFolder.moveMessages(messages, localTrashFolder); } } @@ -3562,7 +3563,7 @@ public class MessagingController implements Runnable { if (folder.equals(account.getTrashFolderName())) { queueSetFlag(account, folder, Boolean.toString(true), Flag.DELETED.toString(), uids); } else { - queueMoveOrCopy(account, folder, account.getTrashFolderName(), false, uids); + queueMoveOrCopy(account, folder, account.getTrashFolderName(), false, uids, uidMap); } processPendingCommands(account); } else if (account.getDeletePolicy() == Account.DELETE_POLICY_MARK_AS_READ) {