From 02acea3bbf464adf2660e6790b6e4aeeede9402c Mon Sep 17 00:00:00 2001 From: Jesse Vincent Date: Wed, 1 Dec 2010 06:04:12 +0000 Subject: [PATCH] replying to a message you sent shouldn't end up sending mail only to you --- src/com/fsck/k9/activity/MessageCompose.java | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/com/fsck/k9/activity/MessageCompose.java b/src/com/fsck/k9/activity/MessageCompose.java index f7f3e3ae3..e5b14cdaf 100644 --- a/src/com/fsck/k9/activity/MessageCompose.java +++ b/src/com/fsck/k9/activity/MessageCompose.java @@ -1704,13 +1704,24 @@ public class MessageCompose extends K9Activity implements OnClickListener, OnFoc Address[] replyToAddresses; if (message.getReplyTo().length > 0) { - addAddresses(mToView, replyToAddresses = message.getReplyTo()); + replyToAddresses = message.getReplyTo(); } else { - addAddresses(mToView, replyToAddresses = message.getFrom()); + replyToAddresses = message.getFrom(); } + // if we're replying to a message we sent, we probably meant + // to reply to the recipient of that message + if (mAccount.isAnIdentity(replyToAddresses)) + { + replyToAddresses = message.getRecipients(RecipientType.TO); + } + + addAddresses(mToView, replyToAddresses); + + + if (message.getMessageId() != null && message.getMessageId().length() > 0) { mInReplyTo = message.getMessageId();