diff --git a/app/internal_packages/composer/lib/composer-header.jsx b/app/internal_packages/composer/lib/composer-header.jsx
index 3cdec195e..2ac0c83b7 100644
--- a/app/internal_packages/composer/lib/composer-header.jsx
+++ b/app/internal_packages/composer/lib/composer-header.jsx
@@ -127,7 +127,7 @@ export default class ComposerHeader extends React.Component {
if (DraftHelpers.isForwardedMessage(this.props.draft)) {
return true;
}
- if (this.props.draft.replyToMessageId) {
+ if (this.props.draft.replyToHeaderMessageId) {
return false;
}
return true;
diff --git a/app/internal_packages/composer/specs/composer-header-spec.jsx b/app/internal_packages/composer/specs/composer-header-spec.jsx
index 2e3acab2a..8189f7f07 100644
--- a/app/internal_packages/composer/specs/composer-header-spec.jsx
+++ b/app/internal_packages/composer/specs/composer-header-spec.jsx
@@ -111,7 +111,7 @@ describe('ComposerHeader', function composerHeader() {
});
it("should be hidden if the message is a reply", () => {
- const draft = new Message({draft: true, subject: 'Re: 1234', replyToMessageId: '123', accountId: TEST_ACCOUNT_ID, headerMessageId: DRAFT_HEADER_MSG_ID});
+ const draft = new Message({draft: true, subject: 'Re: 1234', replyToHeaderMessageId: '123', accountId: TEST_ACCOUNT_ID, headerMessageId: DRAFT_HEADER_MSG_ID});
this.createWithDraft(draft);
expect(this.component.state.enabledFields).toEqual(['textFieldTo', 'fromField'])
});
diff --git a/app/internal_packages/composer/specs/composer-view-spec.cjsx b/app/internal_packages/composer/specs/composer-view-spec.cjsx
index 0e2ebd656..5176921d9 100644
--- a/app/internal_packages/composer/specs/composer-view-spec.cjsx
+++ b/app/internal_packages/composer/specs/composer-view-spec.cjsx
@@ -62,7 +62,7 @@ useFullDraft = ->
files: [f1, f2]
subject: "Test Message 1"
body: "Hello World
This is a test"
- replyToMessageId: null
+ replyToHeaderMessageId: null
makeComposer = (props={}) ->
@composer = NylasTestUtils.renderIntoDocument(
@@ -118,7 +118,7 @@ describe "ComposerView", ->
to: [u2]
subject: "Test Reply Message 1"
body: ""
- replyToMessageId: "1")
+ replyToHeaderMessageId: "1")
.then( =>
sessionSetupComplete = true
)
diff --git a/app/internal_packages/draft-list/lib/draft-list-store.coffee b/app/internal_packages/draft-list/lib/draft-list-store.coffee
index 883e84330..d78169ffe 100644
--- a/app/internal_packages/draft-list/lib/draft-list-store.coffee
+++ b/app/internal_packages/draft-list/lib/draft-list-store.coffee
@@ -56,6 +56,7 @@ class DraftListStore extends NylasStore
# where we set thread.__messages to the message array.
resultSetWithTasks = new MutableQueryResultSet(resultSet)
+ # TODO BG modelWithId: task.headerMessageId does not work
mailboxPerspective.accountIds.forEach (aid) =>
OutboxStore.itemsForAccount(aid).forEach (task) =>
draft = resultSet.modelWithId(task.headerMessageId)
diff --git a/app/spec/stores/draft-factory-spec.es6 b/app/spec/stores/draft-factory-spec.es6
index 8f089400a..e26bfaa44 100644
--- a/app/spec/stores/draft-factory-spec.es6
+++ b/app/spec/stores/draft-factory-spec.es6
@@ -60,6 +60,7 @@ describe('DraftFactory', function draftFactory() {
fakeMessage1 = new Message({
id: 'fake-message-1',
+ headerMessageId: 'fake-message-1@localhost',
accountId: account.id,
to: [new Contact({email: 'ben@nylas.com'}), new Contact({email: 'evan@nylas.com'})],
cc: [new Contact({email: 'mg@nylas.com'}), account.me()],
@@ -73,6 +74,7 @@ describe('DraftFactory', function draftFactory() {
fakeMessageWithFiles = new Message({
id: 'fake-message-with-files',
+ headerMessageId: 'fake-message-with-files@localhost',
accountId: account.id,
to: [new Contact({email: 'ben@nylas.com'}), new Contact({email: 'evan@nylas.com'})],
cc: [new Contact({email: 'mg@nylas.com'}), account.me()],
@@ -87,6 +89,7 @@ describe('DraftFactory', function draftFactory() {
msgFromMe = new Message({
id: 'fake-message-3',
+ headerMessageId: 'fake-message-3@localhost',
accountId: account.id,
to: [new Contact({email: '1@1.com'}), new Contact({email: '2@2.com'})],
cc: [new Contact({email: '3@3.com'}), new Contact({email: '4@4.com'})],
@@ -100,6 +103,7 @@ describe('DraftFactory', function draftFactory() {
msgWithReplyTo = new Message({
id: 'fake-message-reply-to',
+ headerMessageId: 'fake-message-reply-to@localhost',
accountId: account.id,
to: [new Contact({email: '1@1.com'}), new Contact({email: '2@2.com'})],
cc: [new Contact({email: '3@3.com'}), new Contact({email: '4@4.com'})],
@@ -122,6 +126,7 @@ describe('DraftFactory', function draftFactory() {
msgWithReplyToDuplicates = new Message({
id: 'fake-message-reply-to-duplicates',
+ headerMessageId: 'fake-message-reply-to-duplicates@localhost',
accountId: account.id,
to: [new Contact({email: '1@1.com'}), new Contact({email: '2@2.com'})],
cc: [new Contact({email: '1@1.com'}), new Contact({email: '4@4.com'})],
@@ -152,10 +157,10 @@ describe('DraftFactory', function draftFactory() {
});
});
- it("should set the replyToMessageId to the previous message's ids", () => {
+ it("should set the replyToHeaderMessageId to the previous message's ids", () => {
waitsForPromise(() => {
return DraftFactory.createDraftForReply({thread: fakeThread, message: fakeMessage1, type: 'reply'}).then((draft) => {
- expect(draft.replyToMessageId).toEqual(fakeMessage1.id);
+ expect(draft.replyToHeaderMessageId).toEqual(fakeMessage1.headerMessageId);
});
});
});
@@ -378,8 +383,8 @@ describe('DraftFactory', function draftFactory() {
expect(this.model.bcc).toEqual([]);
});
- it("should not set the replyToMessageId", () => {
- expect(this.model.replyToMessageId).toEqual(undefined);
+ it("should not set the replyToHeaderMessageId", () => {
+ expect(this.model.replyToHeaderMessageId).toEqual(undefined);
});
it("should sanitize the HTML", () => {
@@ -433,7 +438,7 @@ describe('DraftFactory', function draftFactory() {
this.existingDraft = new Message({
id: 'asd',
accountId: TEST_ACCOUNT_ID,
- replyToMessageId: fakeMessage1.id,
+ replyToHeaderMessageId: fakeMessage1.headerMessageId,
threadId: fakeMessage1.threadId,
draft: true,
});
diff --git a/app/spec/stores/draft-helpers-spec.es6 b/app/spec/stores/draft-helpers-spec.es6
index ced90b832..6d9b217ad 100644
--- a/app/spec/stores/draft-helpers-spec.es6
+++ b/app/spec/stores/draft-helpers-spec.es6
@@ -54,7 +54,7 @@ xdescribe('DraftHelpers', function describeBlock() {
describe('shouldAppendQuotedText', () => {
it('returns true if message is reply and has no marker', () => {
const draft = {
- replyToMessageId: 1,
+ replyToHeaderMessageId: 1,
body: `