Skip to content

Commit bbde046

Browse files
authored
fix: force show CC/BCC fields on reply all (#10496)
2 parents b05fe1c + fd29476 commit bbde046

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

legacy/ui/legacy/src/main/java/com/fsck/k9/activity/compose/RecipientPresenter.kt

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ class RecipientPresenter(
7474

7575
private var lastFocusedType = RecipientType.TO
7676
private var currentCryptoMode = CryptoMode.NO_CHOICE
77+
private var forceShowCcBcc: Boolean = false
7778

7879
var isForceTextMessageFormat = false
7980
private set
@@ -148,6 +149,7 @@ class RecipientPresenter(
148149

149150
fun initFromReplyToMessage(message: Message?, isReplyAll: Boolean) {
150151
val replyToAddresses = if (isReplyAll) {
152+
forceShowCcBcc = true
151153
replyToParser.getRecipientsToReplyAllTo(message, account)
152154
} else {
153155
replyToParser.getRecipientsToReplyTo(message, account)
@@ -332,7 +334,7 @@ class RecipientPresenter(
332334
fun onSwitchAccount(account: LegacyAccountDto) {
333335
this.account = account
334336

335-
if (account.isAlwaysShowCcBcc) {
337+
if (isAlwaysShowCcBcc()) {
336338
recipientMvpView.setCcVisibility(true)
337339
recipientMvpView.setBccVisibility(true)
338340
updateRecipientExpanderVisibility()
@@ -557,7 +559,7 @@ class RecipientPresenter(
557559
}
558560

559561
fun onNonRecipientFieldFocused() {
560-
if (!account.isAlwaysShowCcBcc) {
562+
if (isAlwaysShowCcBcc().not()) {
561563
hideEmptyExtendedRecipientFields()
562564
}
563565
}
@@ -750,6 +752,10 @@ class RecipientPresenter(
750752
}
751753
}
752754

755+
private fun isAlwaysShowCcBcc(): Boolean {
756+
return forceShowCcBcc || account.isAlwaysShowCcBcc
757+
}
758+
753759
private fun Array<String>.toAddressArray(): Array<Address> {
754760
return flatMap { addressString ->
755761
Address.parseUnencoded(addressString).toList()

0 commit comments

Comments
 (0)