diff --git a/src/com/android/email/activity/MessageCompose.java b/src/com/android/email/activity/MessageCompose.java index 61961d2f9..ff741ff5c 100644 --- a/src/com/android/email/activity/MessageCompose.java +++ b/src/com/android/email/activity/MessageCompose.java @@ -773,6 +773,14 @@ public class MessageCompose extends K9Activity implements OnClickListener, OnFoc */ MessagingController.getInstance(getApplication()).deleteMessage( mAccount, mFolder, mSourceMessage, null); } + if (mDraftUid != null) { + /* + * Message was auto-saved (screen rotation) so delete that draft before sending + */ + Message draftMessage = new MimeMessage(); + draftMessage.setUid(mDraftUid); + MessagingController.getInstance(getApplication()).deleteMessage( mAccount, mAccount.getDraftsFolderName(), draftMessage, null); + } MessagingController.getInstance(getApplication()).sendMessage(mAccount, message, null); } } @@ -802,6 +810,10 @@ public class MessageCompose extends K9Activity implements OnClickListener, OnFoc MessagingController.getInstance(getApplication()).deleteMessage( mAccount, mFolder, mSourceMessage, null); } } + if (mDraftUid != null) { + Message draftMessage = new MimeMessage(); + MessagingController.getInstance(getApplication()).deleteMessage( mAccount, mAccount.getDraftsFolderName(), draftMessage, null); + } mHandler.sendEmptyMessage(MSG_DISCARDED_DRAFT); mDraftNeedsSaving = false; finish();