diff --git a/src/com/fsck/k9/activity/MessageCompose.java b/src/com/fsck/k9/activity/MessageCompose.java index 99813391c..b804710ce 100644 --- a/src/com/fsck/k9/activity/MessageCompose.java +++ b/src/com/fsck/k9/activity/MessageCompose.java @@ -1353,9 +1353,8 @@ public class MessageCompose extends K9Activity implements OnClickListener, */ private TextBody buildText(boolean isDraft, SimpleMessageFormat messageFormat) { String messageText = mMessageContentView.getText().toString(); - String signatureText = mIdentity.getSignatureUse() ? mSignatureView.getCharacters() : null; - TextBodyBuilder textBodyBuilder = new TextBodyBuilder(messageText, signatureText); + TextBodyBuilder textBodyBuilder = new TextBodyBuilder(messageText); /* * Find out if we need to include the original message as quoted text. @@ -1368,14 +1367,22 @@ public class MessageCompose extends K9Activity implements OnClickListener, boolean includeQuotedText = (isDraft || mQuotedTextMode == QuotedTextMode.SHOW); textBodyBuilder.setIncludeQuotedText(includeQuotedText); - textBodyBuilder.setAppendSignature(!isDraft); textBodyBuilder.setInsertSeparator(!isDraft); - textBodyBuilder.setSignatureBeforeQuotedText(mAccount.isSignatureBeforeQuotedText()); - boolean isReplyAfterQuote = (mQuoteStyle == QuoteStyle.PREFIX && mAccount.isReplyAfterQuote()); textBodyBuilder.setReplyAfterQuote(isReplyAfterQuote); + boolean useSignature = (!isDraft && mIdentity.getSignatureUse()); + if (useSignature) { + textBodyBuilder.setAppendSignature(true); + textBodyBuilder.setSignature(mSignatureView.getCharacters()); + textBodyBuilder.setSignatureBeforeQuotedText(mAccount.isSignatureBeforeQuotedText()); + } + else { + textBodyBuilder.setAppendSignature(false); + } + + TextBody body; if (messageFormat == SimpleMessageFormat.HTML) { body = textBodyBuilder.buildTextHtml(mQuotedHtmlContent); diff --git a/src/com/fsck/k9/mail/internet/TextBodyBuilder.java b/src/com/fsck/k9/mail/internet/TextBodyBuilder.java index 3555034ed..dd3a3c90e 100644 --- a/src/com/fsck/k9/mail/internet/TextBodyBuilder.java +++ b/src/com/fsck/k9/mail/internet/TextBodyBuilder.java @@ -13,7 +13,6 @@ public class TextBodyBuilder { private boolean mIncludeQuotedText = true; private boolean mReplyAfterQuote = false; private boolean mSignatureBeforeQuotedText = false; - private boolean mInsertSeparator = false; private boolean mAppendSignature = true; @@ -21,12 +20,8 @@ public class TextBodyBuilder { private String mMessageContent; private String mSignature; - public TextBodyBuilder( - String messageContent, - String signature - ) { + public TextBodyBuilder(String messageContent) { mMessageContent = messageContent; - mSignature = signature; } /** @@ -220,6 +215,10 @@ public class TextBodyBuilder { // setter + public void setSignature(String signature) { + mSignature = signature; + } + public void setIncludeQuotedText(boolean includeQuotedText) { mIncludeQuotedText = includeQuotedText; }