Fix "move to folder" for both IMAP and EAS

* We were zero'ing the server id BEFORE the move, rather than
  afterward; this is fixed in the current CL

Change-Id: I4a5f2b2de5794a110a8f657c80dfeac4955b5909
This commit is contained in:
Marc Blank 2010-08-26 15:42:15 -07:00
parent 25144e2b79
commit 85cf69d371
3 changed files with 11 additions and 3 deletions

View File

@ -735,9 +735,6 @@ public class Controller {
messageId);
ContentValues cv = new ContentValues();
cv.put(EmailContent.MessageColumns.MAILBOX_KEY, mailboxId);
// Set the serverId to 0, since we don't know what the new server id will be
// TODO: Check if this could be cv.setNull(EmailContent.Message.SERVER_ID)
cv.put(EmailContent.Message.SERVER_ID, "0");
mProviderContext.getContentResolver().update(uri, cv, null, null);
if (isMessagingController(account)) {
mLegacyController.processPendingActions(account.mId);

View File

@ -1458,6 +1458,11 @@ public class MessagingController implements Runnable {
// Delete the message from the remote source folder
remoteMessage.setFlag(Flag.DELETED, true);
remoteFolder.expunge();
// Set the serverId to 0, since we don't know what the new server id will be
ContentValues cv = new ContentValues();
cv.put(EmailContent.Message.SERVER_ID, "0");
mContext.getContentResolver().update(ContentUris.withAppendedId(
EmailContent.Message.CONTENT_URI, newMessage.mId), cv, null, null);
}
remoteFolder.close(false);
}

View File

@ -1113,6 +1113,12 @@ public class EasSyncService extends AbstractSyncService {
// If we revert or if we succeeded, we no longer need the update information
mContentResolver.delete(ContentUris.withAppendedId(
Message.UPDATED_CONTENT_URI, req.mMessageId), null, null);
// Set the serverId to 0, since we don't know what the new server id will be
ContentValues cv = new ContentValues();
cv.put(Message.SERVER_ID, "0");
mContentResolver.update(ContentUris.withAppendedId(
Message.CONTENT_URI, msg.mId), cv, null, null);
} else {
// In this case, we're retrying, so do nothing. The request will be handled
// next sync