From 7f72da93e06d74a1f829c1502f3cdbde2d7afc8e Mon Sep 17 00:00:00 2001 From: cketti Date: Mon, 30 Aug 2010 21:27:07 +0000 Subject: [PATCH] Added missing bit of achen.code's patch for issue 2211 (reply below quote) --- src/com/fsck/k9/activity/MessageCompose.java | 33 +++++++++++++++----- 1 file changed, 26 insertions(+), 7 deletions(-) diff --git a/src/com/fsck/k9/activity/MessageCompose.java b/src/com/fsck/k9/activity/MessageCompose.java index e60dcd75a..6542c427c 100644 --- a/src/com/fsck/k9/activity/MessageCompose.java +++ b/src/com/fsck/k9/activity/MessageCompose.java @@ -900,25 +900,44 @@ public class MessageCompose extends K9Activity implements OnClickListener, OnFoc return addresses; } + /* + * Build the Body that will contain the text of the message. We'll decide where to + * include it later. + * + * @param appendSig If true, append the user's signature to the message. + */ private String buildText(boolean appendSig) { - /* - * Build the Body that will contain the text of the message. We'll decide where to - * include it later. - */ + boolean replyAfterQuote = false; + String action = getIntent().getAction(); + if (mAccount.isReplyAfterQuote() && + (ACTION_REPLY.equals(action) || ACTION_REPLY_ALL.equals(action))) + { + replyAfterQuote = true; + } String text = mMessageContentView.getText().toString(); - if (appendSig && mAccount.isSignatureBeforeQuotedText()) + // Placing the signature before the quoted text does not make sense if replyAfterQuote is true. + if (!replyAfterQuote && appendSig && mAccount.isSignatureBeforeQuotedText()) { text = appendSignature(text); } if (mQuotedTextBar.getVisibility() == View.VISIBLE) { - text += "\n" + mQuotedText.getText().toString(); + if (replyAfterQuote) + { + text = mQuotedText.getText().toString() + "\n" + text; + } + else + { + text += "\n\n" + mQuotedText.getText().toString(); + } } - if (appendSig && !mAccount.isSignatureBeforeQuotedText()) + // Note: If user has selected reply after quote AND signature before quote, ignore the + // latter setting and append the signature at the end. + if (appendSig && (!mAccount.isSignatureBeforeQuotedText() || replyAfterQuote)) { text = appendSignature(text); }