set signature parameter when it is only necessary
This commit is contained in:
parent
00fb83e1b3
commit
e163fb87e1
2 changed files with 17 additions and 11 deletions
|
@ -1353,9 +1353,8 @@ public class MessageCompose extends K9Activity implements OnClickListener,
|
||||||
*/
|
*/
|
||||||
private TextBody buildText(boolean isDraft, SimpleMessageFormat messageFormat) {
|
private TextBody buildText(boolean isDraft, SimpleMessageFormat messageFormat) {
|
||||||
String messageText = mMessageContentView.getText().toString();
|
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.
|
* 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);
|
boolean includeQuotedText = (isDraft || mQuotedTextMode == QuotedTextMode.SHOW);
|
||||||
textBodyBuilder.setIncludeQuotedText(includeQuotedText);
|
textBodyBuilder.setIncludeQuotedText(includeQuotedText);
|
||||||
|
|
||||||
textBodyBuilder.setAppendSignature(!isDraft);
|
|
||||||
textBodyBuilder.setInsertSeparator(!isDraft);
|
textBodyBuilder.setInsertSeparator(!isDraft);
|
||||||
|
|
||||||
textBodyBuilder.setSignatureBeforeQuotedText(mAccount.isSignatureBeforeQuotedText());
|
|
||||||
|
|
||||||
boolean isReplyAfterQuote = (mQuoteStyle == QuoteStyle.PREFIX && mAccount.isReplyAfterQuote());
|
boolean isReplyAfterQuote = (mQuoteStyle == QuoteStyle.PREFIX && mAccount.isReplyAfterQuote());
|
||||||
textBodyBuilder.setReplyAfterQuote(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;
|
TextBody body;
|
||||||
if (messageFormat == SimpleMessageFormat.HTML) {
|
if (messageFormat == SimpleMessageFormat.HTML) {
|
||||||
body = textBodyBuilder.buildTextHtml(mQuotedHtmlContent);
|
body = textBodyBuilder.buildTextHtml(mQuotedHtmlContent);
|
||||||
|
|
|
@ -13,7 +13,6 @@ public class TextBodyBuilder {
|
||||||
private boolean mIncludeQuotedText = true;
|
private boolean mIncludeQuotedText = true;
|
||||||
private boolean mReplyAfterQuote = false;
|
private boolean mReplyAfterQuote = false;
|
||||||
private boolean mSignatureBeforeQuotedText = false;
|
private boolean mSignatureBeforeQuotedText = false;
|
||||||
|
|
||||||
private boolean mInsertSeparator = false;
|
private boolean mInsertSeparator = false;
|
||||||
private boolean mAppendSignature = true;
|
private boolean mAppendSignature = true;
|
||||||
|
|
||||||
|
@ -21,12 +20,8 @@ public class TextBodyBuilder {
|
||||||
private String mMessageContent;
|
private String mMessageContent;
|
||||||
private String mSignature;
|
private String mSignature;
|
||||||
|
|
||||||
public TextBodyBuilder(
|
public TextBodyBuilder(String messageContent) {
|
||||||
String messageContent,
|
|
||||||
String signature
|
|
||||||
) {
|
|
||||||
mMessageContent = messageContent;
|
mMessageContent = messageContent;
|
||||||
mSignature = signature;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -220,6 +215,10 @@ public class TextBodyBuilder {
|
||||||
|
|
||||||
// setter
|
// setter
|
||||||
|
|
||||||
|
public void setSignature(String signature) {
|
||||||
|
mSignature = signature;
|
||||||
|
}
|
||||||
|
|
||||||
public void setIncludeQuotedText(boolean includeQuotedText) {
|
public void setIncludeQuotedText(boolean includeQuotedText) {
|
||||||
mIncludeQuotedText = includeQuotedText;
|
mIncludeQuotedText = includeQuotedText;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue