1
0
mirror of https://github.com/moparisthebest/k-9 synced 2025-02-07 10:40:11 -05:00

Fixed issue 762

+ more draft handling fixes
This commit is contained in:
Bao-Long Nguyen-Trong 2009-11-16 20:47:27 +00:00
parent 4cc22f8208
commit aa18be9c96

View File

@ -496,43 +496,45 @@ public class MessageCompose extends K9Activity implements OnClickListener, OnFoc
mSignatureView.addTextChangedListener(sigwatcher); mSignatureView.addTextChangedListener(sigwatcher);
if (!mSourceMessageProcessed) { if (!mSourceMessageProcessed) {
updateFrom(); updateFrom();
updateSignature(); updateSignature();
if (ACTION_REPLY.equals(action) || ACTION_REPLY_ALL.equals(action) || ACTION_FORWARD.equals(action) || ACTION_EDIT_DRAFT.equals(action)) { if (ACTION_REPLY.equals(action) || ACTION_REPLY_ALL.equals(action) || ACTION_FORWARD.equals(action) || ACTION_EDIT_DRAFT.equals(action)) {
/* /*
* If we need to load the message we add ourself as a message listener here * If we need to load the message we add ourself as a message listener here
* so we can kick it off. Normally we add in onResume but we don't * so we can kick it off. Normally we add in onResume but we don't
* want to reload the message every time the activity is resumed. * want to reload the message every time the activity is resumed.
* There is no harm in adding twice. * There is no harm in adding twice.
*/ */
MessagingController.getInstance(getApplication()).addListener(mListener); MessagingController.getInstance(getApplication()).addListener(mListener);
MessagingController.getInstance(getApplication()).loadMessageForView( mAccount, mFolder, mSourceMessageUid, null); MessagingController.getInstance(getApplication()).loadMessageForView( mAccount, mFolder, mSourceMessageUid, null);
}
if (!ACTION_EDIT_DRAFT.equals(action)) {
String bccAddress = mAccount.getAlwaysBcc();
if (bccAddress!=null
&& !"".equals(bccAddress)) {
addAddress(mBccView, new Address(mAccount.getAlwaysBcc(), ""));
} }
}
Log.d(Email.LOG_TAG, "action = " + action + ", mAccount = " + mAccount + ", mFolder = " + mFolder + ", mSourceMessageUid = " + mSourceMessageUid); if (!ACTION_EDIT_DRAFT.equals(action)) {
if ((ACTION_REPLY.equals(action) || ACTION_REPLY_ALL.equals(action)) && mAccount != null && mFolder != null && mSourceMessageUid != null) { String bccAddress = mAccount.getAlwaysBcc();
Log.d(Email.LOG_TAG, "Setting message ANSWERED flag to true"); if (bccAddress!=null
// TODO: Really, we should wait until we send the message, but that would require saving the original && !"".equals(bccAddress)) {
// message info along with a Draft copy, in case it is left in Drafts for a while before being sent addAddress(mBccView, new Address(mAccount.getAlwaysBcc(), ""));
MessagingController.getInstance(getApplication()).setMessageFlag(mAccount, mFolder, mSourceMessageUid, Flag.ANSWERED, true); }
} }
updateTitle(); Log.d(Email.LOG_TAG, "action = " + action + ", mAccount = " + mAccount + ", mFolder = " + mFolder + ", mSourceMessageUid = " + mSourceMessageUid);
} if ((ACTION_REPLY.equals(action) || ACTION_REPLY_ALL.equals(action)) && mAccount != null && mFolder != null && mSourceMessageUid != null) {
Log.d(Email.LOG_TAG, "Setting message ANSWERED flag to true");
// TODO: Really, we should wait until we send the message, but that would require saving the original
// message info along with a Draft copy, in case it is left in Drafts for a while before being sent
MessagingController.getInstance(getApplication()).setMessageFlag(mAccount, mFolder, mSourceMessageUid, Flag.ANSWERED, true);
}
updateTitle();
}
if (ACTION_REPLY.equals(action) || ACTION_REPLY_ALL.equals(action) || ACTION_EDIT_DRAFT.equals(action)) { if (ACTION_REPLY.equals(action) || ACTION_REPLY_ALL.equals(action) || ACTION_EDIT_DRAFT.equals(action)) {
//change focus to message body. //change focus to message body.
mMessageContentView.requestFocus(); mMessageContentView.requestFocus();
} }
mDraftNeedsSaving = false;
} }
public void onResume() { public void onResume() {
@ -819,6 +821,7 @@ public class MessageCompose extends K9Activity implements OnClickListener, OnFoc
} }
private void onSave() { private void onSave() {
mDraftNeedsSaving = true;
saveIfNeeded(); saveIfNeeded();
finish(); finish();
} }