From 4c6bc1a81b05660db7c6f41bdfcbb418c271a5c1 Mon Sep 17 00:00:00 2001 From: Vincent Breitmoser Date: Tue, 17 May 2016 12:29:04 +0200 Subject: [PATCH] compose: copy other to and and cc addresses only on reply all --- .../com/fsck/k9/activity/MessageCompose.java | 3 ++- .../k9/activity/compose/RecipientPresenter.java | 17 ++++++++++------- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/k9mail/src/main/java/com/fsck/k9/activity/MessageCompose.java b/k9mail/src/main/java/com/fsck/k9/activity/MessageCompose.java index cdc563ee8..e4e6df959 100644 --- a/k9mail/src/main/java/com/fsck/k9/activity/MessageCompose.java +++ b/k9mail/src/main/java/com/fsck/k9/activity/MessageCompose.java @@ -1598,7 +1598,8 @@ public class MessageCompose extends K9Activity implements OnClickListener, * If a reply-to was included with the message use that, otherwise use the from * or sender address. */ - recipientPresenter.initFromReplyToMessage(message); + boolean isReplyAll = mAction == Action.REPLY_ALL; + recipientPresenter.initFromReplyToMessage(message, isReplyAll); if (message.getMessageId() != null && message.getMessageId().length() > 0) { mInReplyTo = message.getMessageId(); diff --git a/k9mail/src/main/java/com/fsck/k9/activity/compose/RecipientPresenter.java b/k9mail/src/main/java/com/fsck/k9/activity/compose/RecipientPresenter.java index 23faac60e..6dc7ba1a4 100644 --- a/k9mail/src/main/java/com/fsck/k9/activity/compose/RecipientPresenter.java +++ b/k9mail/src/main/java/com/fsck/k9/activity/compose/RecipientPresenter.java @@ -133,7 +133,7 @@ public class RecipientPresenter implements PermissionPingCallback { return false; } - public void initFromReplyToMessage(Message message) { + public void initFromReplyToMessage(Message message, boolean isReplyAll) { Address[] replyToAddresses = ReplyToParser.getRecipientsToReplyTo(message); // if we're replying to a message we sent, we probably meant @@ -144,6 +144,15 @@ public class RecipientPresenter implements PermissionPingCallback { addRecipientsFromAddresses(RecipientType.TO, replyToAddresses); + boolean shouldSendAsPgpInline = composePgpInlineDecider.shouldReplyInline(message); + if (shouldSendAsPgpInline) { + cryptoEnablePgpInline = true; + } + + if (!isReplyAll) { + return; + } + if (message.getReplyTo().length > 0) { for (Address address : message.getFrom()) { if (!account.isAnIdentity(address) && !Utility.arrayContains(replyToAddresses, address)) { @@ -156,7 +165,6 @@ public class RecipientPresenter implements PermissionPingCallback { if (!account.isAnIdentity(address) && !Utility.arrayContains(replyToAddresses, address)) { addToAddresses(address); } - } for (Address address : message.getRecipients(RecipientType.CC)) { @@ -164,11 +172,6 @@ public class RecipientPresenter implements PermissionPingCallback { addCcAddresses(address); } } - - boolean shouldSendAsPgpInline = composePgpInlineDecider.shouldReplyInline(message); - if (shouldSendAsPgpInline) { - cryptoEnablePgpInline = true; - } } public void initFromMailto(MailTo mailTo) {