From dece5050c2b7004623ab9e38eaa7b75257fe15e8 Mon Sep 17 00:00:00 2001 From: Todd Kennedy Date: Thu, 17 Mar 2011 13:16:36 -0700 Subject: [PATCH] Don't sync messages moved from the sent folder When processing message updates, we handle messages in the "sent" folder specially. We continue to do that. However, we must also check that the given message is still in the "sent" folder. bug 4096266 Change-Id: Iaa47512fad287e63d8216b755a761b52b324cfff --- src/com/android/email/MessagingController.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/com/android/email/MessagingController.java b/src/com/android/email/MessagingController.java index b6bb9676f..53061a190 100644 --- a/src/com/android/email/MessagingController.java +++ b/src/com/android/email/MessagingController.java @@ -1247,6 +1247,11 @@ public class MessagingController implements Runnable { } // upsync the message long id = upsyncs2.getLong(EmailContent.Message.ID_PROJECTION_COLUMN); + EmailContent.Message newMessage = + EmailContent.Message.restoreMessageWithId(mContext, id); + if (newMessage != null && newMessage.mMailboxKey != mailboxId) { + continue; // The message moved to a different mailbox; skip it + } lastMessageId = id; processUploadMessage(resolver, remoteStore, account, mailbox, id); }