From 4260dc75d3f386c2f4ffcb05f5fef026b9136f49 Mon Sep 17 00:00:00 2001 From: Koji Arai Date: Fri, 2 May 2014 10:45:20 +0900 Subject: [PATCH] more refactor about quoted text --- src/com/fsck/k9/activity/MessageCompose.java | 26 +++++++++++--------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/src/com/fsck/k9/activity/MessageCompose.java b/src/com/fsck/k9/activity/MessageCompose.java index 9e8e4bdb5..1240f2235 100644 --- a/src/com/fsck/k9/activity/MessageCompose.java +++ b/src/com/fsck/k9/activity/MessageCompose.java @@ -1365,13 +1365,24 @@ public class MessageCompose extends K9Activity implements OnClickListener, * opens a saved draft. */ boolean includeQuotedText = (isDraft || mQuotedTextMode == QuotedTextMode.SHOW); - textBodyBuilder.setIncludeQuotedText(includeQuotedText); + boolean isReplyAfterQuote = (mQuoteStyle == QuoteStyle.PREFIX && mAccount.isReplyAfterQuote()); + + textBodyBuilder.setIncludeQuotedText(false); + if (includeQuotedText) { + if (messageFormat == SimpleMessageFormat.HTML && mQuotedHtmlContent != null) { + textBodyBuilder.setIncludeQuotedText(true); + textBodyBuilder.setQuotedTextHtml(mQuotedHtmlContent); + textBodyBuilder.setReplyAfterQuote(isReplyAfterQuote); + } + if (messageFormat == SimpleMessageFormat.TEXT) { + textBodyBuilder.setIncludeQuotedText(true); + textBodyBuilder.setQuotedText(mQuotedText.getText().toString()); + textBodyBuilder.setReplyAfterQuote(isReplyAfterQuote); + } + } textBodyBuilder.setInsertSeparator(!isDraft); - boolean isReplyAfterQuote = (mQuoteStyle == QuoteStyle.PREFIX && mAccount.isReplyAfterQuote()); - textBodyBuilder.setReplyAfterQuote(isReplyAfterQuote); - boolean useSignature = (!isDraft && mIdentity.getSignatureUse()); if (useSignature) { textBodyBuilder.setAppendSignature(true); @@ -1384,16 +1395,9 @@ public class MessageCompose extends K9Activity implements OnClickListener, TextBody body; if (messageFormat == SimpleMessageFormat.HTML) { - if (mQuotedHtmlContent == null) { - textBodyBuilder.setIncludeQuotedText(false); - } - else { - textBodyBuilder.setQuotedTextHtml(mQuotedHtmlContent); - } body = textBodyBuilder.buildTextHtml(); } else { - textBodyBuilder.setQuotedText(mQuotedText.getText().toString()); body = textBodyBuilder.buildTextPlain(); } return body;