Only delete attachments from drafts

We should only be deleting attachments from draft messages and not all
messages.

bug 3489176

Change-Id: Ia1bd2894f3aabc1bfbfb36e2f5c486b47d6edf4f
This commit is contained in:
Todd Kennedy 2011-03-08 09:49:50 -08:00
parent 39121c758d
commit a94804c49e

View File

@ -1243,7 +1243,7 @@ public class MessageCompose extends Activity implements OnClickListener, OnFocus
Attachment attachment = (Attachment) attachmentView.getTag();
mAttachments.removeView(attachmentView);
updateAttachmentContainer();
if (attachment.isSaved()) {
if (attachment.mMessageKey == mDraft.mId && attachment.isSaved()) {
// The following async task for deleting attachments:
// - can be started multiple times in parallel (to delete multiple attachments).
// - need not be interrupted on activity exit, instead should run to completion.