MessageCompose: fix delete quoted on reply/forward for EAS.
Also fix display of quoted html text for a draft (Exchange 2007). Bug 2363249 Bug 2444496
This commit is contained in:
parent
5cb0ccc25b
commit
1575e7860d
@ -577,6 +577,8 @@ public class MessageCompose extends Activity implements OnClickListener, OnFocus
|
||||
Body.restoreReplyTextWithMessageId(MessageCompose.this, message.mId);
|
||||
message.mIntroText =
|
||||
Body.restoreIntroTextWithMessageId(MessageCompose.this, message.mId);
|
||||
message.mSourceKey = Body.restoreBodySourceKey(MessageCompose.this,
|
||||
message.mId);
|
||||
} else {
|
||||
message.mHtmlReply = null;
|
||||
message.mTextReply = null;
|
||||
@ -759,8 +761,7 @@ public class MessageCompose extends Activity implements OnClickListener, OnFocus
|
||||
|| ACTION_FORWARD.equals(mAction)) {
|
||||
message.mSourceKey = mSource.mId;
|
||||
// Get the body of the source message here
|
||||
// Note that the following commented line will be useful when we use HTML in replies
|
||||
//message.mHtmlReply = mSource.mHtml;
|
||||
message.mHtmlReply = mSource.mHtml;
|
||||
message.mTextReply = mSource.mText;
|
||||
}
|
||||
|
||||
@ -842,6 +843,7 @@ public class MessageCompose extends Activity implements OnClickListener, OnFocus
|
||||
values.put(BodyColumns.TEXT_REPLY, mDraft.mTextReply);
|
||||
values.put(BodyColumns.HTML_REPLY, mDraft.mHtmlReply);
|
||||
values.put(BodyColumns.INTRO_TEXT, mDraft.mIntroText);
|
||||
values.put(BodyColumns.SOURCE_MESSAGE_KEY, mDraft.mSourceKey);
|
||||
Body.updateBodyWithMessageId(MessageCompose.this, mDraft.mId, values);
|
||||
} else {
|
||||
// mDraft.mId is set upon return of saveToMailbox()
|
||||
@ -1031,6 +1033,7 @@ public class MessageCompose extends Activity implements OnClickListener, OnFocus
|
||||
mDraft.mIntroText = null;
|
||||
mDraft.mTextReply = null;
|
||||
mDraft.mHtmlReply = null;
|
||||
mDraft.mSourceKey = 0;
|
||||
setDraftNeedsSaving(true);
|
||||
break;
|
||||
}
|
||||
|
@ -228,6 +228,9 @@ public abstract class EmailContent {
|
||||
};
|
||||
public static final int COMMON_PROJECTION_COLUMN_TEXT = 1;
|
||||
|
||||
private static final String[] PROJECTION_SOURCE_KEY =
|
||||
new String[] { BodyColumns.SOURCE_MESSAGE_KEY };
|
||||
|
||||
public long mMessageKey;
|
||||
public String mHtmlContent;
|
||||
public String mTextContent;
|
||||
@ -313,6 +316,21 @@ public abstract class EmailContent {
|
||||
}
|
||||
}
|
||||
|
||||
public static long restoreBodySourceKey(Context context, long messageId) {
|
||||
Cursor c = context.getContentResolver().query(Body.CONTENT_URI,
|
||||
Body.PROJECTION_SOURCE_KEY,
|
||||
Body.MESSAGE_KEY + "=?", new String[] {Long.toString(messageId)}, null);
|
||||
try {
|
||||
if (c.moveToFirst()) {
|
||||
return c.getLong(0);
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
} finally {
|
||||
c.close();
|
||||
}
|
||||
}
|
||||
|
||||
private static String restoreTextWithMessageId(Context context, long messageId,
|
||||
String[] projection) {
|
||||
Cursor c = context.getContentResolver().query(Body.CONTENT_URI, projection,
|
||||
|
@ -605,6 +605,8 @@ public class ProviderTests extends ProviderTestCase2<EmailProvider> {
|
||||
Body.restoreReplyHtmlWithMessageId(mMockContext, messageId));
|
||||
assertEquals(message1.mIntroText,
|
||||
Body.restoreIntroTextWithMessageId(mMockContext, messageId));
|
||||
assertEquals(message1.mSourceKey,
|
||||
Body.restoreBodySourceKey(mMockContext, messageId));
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user