compose: copy other to and and cc addresses only on reply all

This commit is contained in:
Vincent Breitmoser 2016-05-17 12:29:04 +02:00
parent 8d631fd905
commit 4c6bc1a81b
2 changed files with 12 additions and 8 deletions

View file

@ -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();

View file

@ -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) {