1
0
mirror of https://github.com/moparisthebest/k-9 synced 2024-11-27 11:42:16 -05:00

adapt to product code

This commit is contained in:
Koji Arai 2014-05-02 13:42:05 +09:00
parent 215ada2e77
commit 0a09060ed7

View File

@ -16,30 +16,28 @@ class TestingTextBodyBuilder extends TextBodyBuilder {
QuoteStyle quoteStyle, QuoteStyle quoteStyle,
boolean replyAfterQuote, boolean replyAfterQuote,
boolean signatureBeforeQuotedText, boolean signatureBeforeQuotedText,
boolean signatureUse, boolean useSignature,
String messageContent, String messageText,
String signature) { String signatureText) {
super(messageContent); super(messageText);
if (isDraft || includeQuotedText) { includeQuotedText = (isDraft || includeQuotedText);
if (includeQuotedText) {
this.setIncludeQuotedText(true); this.setIncludeQuotedText(true);
this.setReplyAfterQuote(quoteStyle == QuoteStyle.PREFIX && replyAfterQuote);
} else { } else {
this.setIncludeQuotedText(false); this.setIncludeQuotedText(false);
} }
this.setAppendSignature(!isDraft);
this.setInsertSeparator(!isDraft); this.setInsertSeparator(!isDraft);
useSignature = (!isDraft && useSignature);
if (useSignature) {
this.setAppendSignature(true);
this.setSignature(signatureText);
this.setSignatureBeforeQuotedText(signatureBeforeQuotedText); this.setSignatureBeforeQuotedText(signatureBeforeQuotedText);
if (quoteStyle == QuoteStyle.PREFIX && replyAfterQuote) {
this.setReplyAfterQuote(true);
} else { } else {
this.setReplyAfterQuote(false); this.setAppendSignature(false);
}
if (signatureUse) {
this.setSignature(signature);
} }
} }
@ -128,8 +126,8 @@ public class TextBodyBuilderTest {
} }
String quotedText = "quoted text"; String quotedText = "quoted text";
String messageContent = "message content"; String messageText = "message content";
String signature = "signature"; String signatureText = "signature";
TestingTextBodyBuilder textBodyBuilder = new TestingTextBodyBuilder( TestingTextBodyBuilder textBodyBuilder = new TestingTextBodyBuilder(
includeQuotedText, includeQuotedText,
@ -138,8 +136,8 @@ public class TextBodyBuilderTest {
isReplyAfterQuote, isReplyAfterQuote,
isSignatureBeforeQuotedText, isSignatureBeforeQuotedText,
isSignatureUse, isSignatureUse,
messageContent, messageText,
signature signatureText
); );
textBodyBuilder.setQuotedText(quotedText); textBodyBuilder.setQuotedText(quotedText);
TextBody textBody = textBodyBuilder.buildTextPlain(); TextBody textBody = textBodyBuilder.buildTextPlain();
@ -303,8 +301,8 @@ public class TextBodyBuilderTest {
String quotedText = "quoted text"; String quotedText = "quoted text";
insertableHtmlContent.setQuotedContent(new StringBuilder(quotedText)); insertableHtmlContent.setQuotedContent(new StringBuilder(quotedText));
String messageContent = "message content"; String messageText = "message content";
String signature = "signature"; String signatureText = "signature";
TestingTextBodyBuilder textBodyBuilder = new TestingTextBodyBuilder( TestingTextBodyBuilder textBodyBuilder = new TestingTextBodyBuilder(
includeQuotedText, includeQuotedText,
@ -313,8 +311,8 @@ public class TextBodyBuilderTest {
isReplyAfterQuote, isReplyAfterQuote,
isSignatureBeforeQuotedText, isSignatureBeforeQuotedText,
isSignatureUse, isSignatureUse,
messageContent, messageText,
signature signatureText
); );
textBodyBuilder.setQuotedTextHtml(insertableHtmlContent); textBodyBuilder.setQuotedTextHtml(insertableHtmlContent);
TextBody textBody = textBodyBuilder.buildTextHtml(); TextBody textBody = textBodyBuilder.buildTextHtml();