Merge pull request #5668 from k9mail/reply_to_header_in_drafts

Load Reply-To header from draft messages
This commit is contained in:
cketti 2021-09-16 05:46:28 +02:00 committed by GitHub
commit d061e5aab5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 0 deletions

View file

@ -1373,6 +1373,7 @@ public class MessageCompose extends K9Activity implements OnClickListener,
draftMessageId = messagingController.getId(message);
subjectView.setText(messageViewInfo.subject);
replyToPresenter.initFromDraftMessage(message);
recipientPresenter.initFromDraftMessage(message);
// Read In-Reply-To header from draft

View file

@ -3,6 +3,7 @@ package com.fsck.k9.activity.compose
import android.os.Bundle
import com.fsck.k9.Identity
import com.fsck.k9.mail.Address
import com.fsck.k9.mail.Message
private const val STATE_KEY_REPLY_TO_SHOWN = "com.fsck.k9.activity.compose.ReplyToPresenter.replyToShown"
@ -10,6 +11,13 @@ class ReplyToPresenter(private val view: ReplyToView) {
private lateinit var identity: Identity
private var identityReplyTo: Array<Address>? = null
fun initFromDraftMessage(message: Message) {
message.replyTo.takeIf { it.isNotEmpty() }?.let { addresses ->
view.silentlyAddAddresses(addresses)
view.isVisible = true
}
}
fun getAddresses(): Array<Address> {
return view.getAddresses()
}