From 2f99314326de0ee3bab9fbf18d511b24c0574ee1 Mon Sep 17 00:00:00 2001 From: Marc Blank Date: Sun, 20 Sep 2009 13:56:13 -0700 Subject: [PATCH] Handle issues in SmartReply/SmartForward * SmartReply doesn't put in header information related to the original, which looks like a bug in EAS, so we add our own (as we do for SMTP) * SmartForward works properly, but doesn't put any CRLF between the new text and the original; we fix that by adding one after the original text. * Addresses #2132658 Change-Id: I48efec0d02598a8e9ce2a54b4c66464e8e62e5d6 --- .../email/mail/transport/Rfc822Output.java | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/com/android/email/mail/transport/Rfc822Output.java b/src/com/android/email/mail/transport/Rfc822Output.java index 2b13ceb32..d1e812bc3 100644 --- a/src/com/android/email/mail/transport/Rfc822Output.java +++ b/src/com/android/email/mail/transport/Rfc822Output.java @@ -65,9 +65,22 @@ public class Rfc822Output { if (body == null) { return null; } + String text = body.mTextContent; + String fromAsString = Address.unpackToString(message.mFrom); + int flags = message.mFlags; if (!appendQuotedText) { + // appendQuotedText is set to false for use by SmartReply/SmartForward in EAS. + // SmartReply doesn't appear to work properly, so we will still add the header into + // to the original message. + // SmartForward doesn't put any kind of break between the original and the new text, + // so we add a CRLF + if ((flags & Message.FLAG_TYPE_REPLY) != 0) { + text += context.getString(R.string.message_compose_reply_header_fmt, fromAsString); + } else { + text += "\r\n"; + } return text; } @@ -77,8 +90,6 @@ public class Rfc822Output { Matcher matcher = PATTERN_ENDLINE_CRLF.matcher(quotedText); quotedText = matcher.replaceAll("\n"); } - String fromAsString = Address.unpackToString(message.mFrom); - int flags = message.mFlags; if ((flags & Message.FLAG_TYPE_REPLY) != 0) { text += context.getString(R.string.message_compose_reply_header_fmt, fromAsString); if (quotedText != null) {