fix(fwd): Do not mention Bcc'd recipeints in forward headers #1873

This commit is contained in:
Ben Gotow 2016-04-06 14:51:17 -07:00
parent 15eafa7c55
commit 4329f53ce8
2 changed files with 10 additions and 7 deletions

View file

@ -338,7 +338,7 @@ describe("DraftFactory", () => {
describe("onComposeForward", () => {
beforeEach(() => {
waitsForPromise(() => {
return DraftFactory.createDraftForForward({thread: fakeThread, message: fakeMessage2}).then((draft) => {
return DraftFactory.createDraftForForward({thread: fakeThread, message: fakeMessage1}).then((draft) => {
this.model = draft;
});
});
@ -347,13 +347,17 @@ describe("DraftFactory", () => {
it("should include forwarded message text, in a div rather than a blockquote", () => {
expect(this.model.body.indexOf('gmail_quote') > 0).toBe(true);
expect(this.model.body.indexOf('blockquote') > 0).toBe(false);
expect(this.model.body.indexOf(fakeMessage2.body) > 0).toBe(true);
expect(this.model.body.indexOf(fakeMessage1.body) > 0).toBe(true);
expect(this.model.body.indexOf('---------- Forwarded message ---------') > 0).toBe(true);
expect(this.model.body.indexOf('From: ben@nylas.com') > 0).toBe(true);
expect(this.model.body.indexOf('Subject: Re: Fake Subject') > 0).toBe(true);
expect(this.model.body.indexOf('To: customer@example.com') > 0).toBe(true);
expect(this.model.body.indexOf('From: Customer <customer@example.com>') > 0).toBe(true);
expect(this.model.body.indexOf('Subject: Fake Subject') > 0).toBe(true);
expect(this.model.body.indexOf('To: ben@nylas.com, evan@nylas.com') > 0).toBe(true);
expect(this.model.body.indexOf('Cc: mg@nylas.com, Nylas Test <tester@nylas.com>') > 0).toBe(true);
});
it("should not mention BCC'd recipients in the forwarded message header", () => {
expect(this.model.body.indexOf('recruiting@nylas.com') > 0).toBe(false);
});
it("should not address the message to anyone", () => {
expect(this.model.to).toEqual([]);
expect(this.model.cc).toEqual([]);

View file

@ -129,8 +129,7 @@ class DraftFactory
fields.push("Subject: #{message.subject}")
fields.push("Date: #{message.formattedDate()}")
fields.push("To: #{contactsAsHtml(message.to)}") if message.to.length > 0
fields.push("CC: #{contactsAsHtml(message.cc)}") if message.cc.length > 0
fields.push("BCC: #{contactsAsHtml(message.bcc)}") if message.bcc.length > 0
fields.push("Cc: #{contactsAsHtml(message.cc)}") if message.cc.length > 0
@_prepareBodyForQuoting(message.body).then (body) =>
@createDraft(
subject: subjectWithPrefix(message.subject, 'Fwd:')