Search in sources :

Example 1 with SaveMessageTask

use of com.fsck.k9.activity.compose.SaveMessageTask in project k-9 by k9mail.

the class MessageCompose method onMessageBuildSuccess.

@Override
public void onMessageBuildSuccess(MimeMessage message, boolean isDraft) {
    if (isDraft) {
        changesMadeSinceLastSave = false;
        currentMessageBuilder = null;
        if (action == Action.EDIT_DRAFT && relatedMessageReference != null) {
            message.setUid(relatedMessageReference.getUid());
        }
        // TODO more appropriate logic here? not sure
        boolean saveRemotely = !recipientPresenter.getCurrentCryptoStatus().shouldUsePgpMessageBuilder();
        new SaveMessageTask(getApplicationContext(), account, contacts, internalMessageHandler, message, draftId, saveRemotely).execute();
        if (finishAfterDraftSaved) {
            finish();
        } else {
            setProgressBarIndeterminateVisibility(false);
        }
    } else {
        currentMessageBuilder = null;
        new SendMessageTask(getApplicationContext(), account, contacts, message, draftId != INVALID_DRAFT_ID ? draftId : null, relatedMessageReference).execute();
        finish();
    }
}
Also used : SaveMessageTask(com.fsck.k9.activity.compose.SaveMessageTask)

Aggregations

SaveMessageTask (com.fsck.k9.activity.compose.SaveMessageTask)1