From f8eb22f1686872ea343ecfd96da1e8ec0302bf13 Mon Sep 17 00:00:00 2001 From: Jesse Vincent Date: Fri, 31 Oct 2008 22:39:00 +0000 Subject: [PATCH] Factor out signature generation * No longer generate a signature when we don't have one defined --- src/com/fsck/k9/activity/MessageCompose.java | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/src/com/fsck/k9/activity/MessageCompose.java b/src/com/fsck/k9/activity/MessageCompose.java index 89ab947a5..5a4cf273a 100644 --- a/src/com/fsck/k9/activity/MessageCompose.java +++ b/src/com/fsck/k9/activity/MessageCompose.java @@ -549,7 +549,10 @@ public class MessageCompose extends Activity implements OnClickListener, OnFocus } } - text += "\n-- \n" + mAccount.getSignature(); + + + text = appendSignature(text); + TextBody body = new TextBody(text); @@ -591,6 +594,18 @@ public class MessageCompose extends Activity implements OnClickListener, OnFocus return message; } + private String appendSignature (String text) { + String mSignature; + mSignature = mAccount.getSignature(); + + if (mSignature != null && ! mSignature.contentEquals("")){ + text += "\n-- \n" + mAccount.getSignature(); + } + + return text; + } + + private void sendOrSaveMessage(boolean save) { /* * Create the message from all the data the user has entered.