1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-08-13 17:03:48 -04:00

more refactor about quoted text

This commit is contained in:
Koji Arai 2014-05-02 10:45:20 +09:00
parent 68850b1dc9
commit 4260dc75d3

View File

@ -1365,13 +1365,24 @@ public class MessageCompose extends K9Activity implements OnClickListener,
* opens a saved draft. * opens a saved draft.
*/ */
boolean includeQuotedText = (isDraft || mQuotedTextMode == QuotedTextMode.SHOW); 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); textBodyBuilder.setInsertSeparator(!isDraft);
boolean isReplyAfterQuote = (mQuoteStyle == QuoteStyle.PREFIX && mAccount.isReplyAfterQuote());
textBodyBuilder.setReplyAfterQuote(isReplyAfterQuote);
boolean useSignature = (!isDraft && mIdentity.getSignatureUse()); boolean useSignature = (!isDraft && mIdentity.getSignatureUse());
if (useSignature) { if (useSignature) {
textBodyBuilder.setAppendSignature(true); textBodyBuilder.setAppendSignature(true);
@ -1384,16 +1395,9 @@ public class MessageCompose extends K9Activity implements OnClickListener,
TextBody body; TextBody body;
if (messageFormat == SimpleMessageFormat.HTML) { if (messageFormat == SimpleMessageFormat.HTML) {
if (mQuotedHtmlContent == null) {
textBodyBuilder.setIncludeQuotedText(false);
}
else {
textBodyBuilder.setQuotedTextHtml(mQuotedHtmlContent);
}
body = textBodyBuilder.buildTextHtml(); body = textBodyBuilder.buildTextHtml();
} }
else { else {
textBodyBuilder.setQuotedText(mQuotedText.getText().toString());
body = textBodyBuilder.buildTextPlain(); body = textBodyBuilder.buildTextPlain();
} }
return body; return body;