Bug 1166206 - Use makeFromDisplayAddress in setting Compose from field, r=mkmelin, a=rkent
authorR Kent James <rkent@caspia.com>
Wed, 27 May 2015 15:17:31 -0700
changeset 26061 7a23f1e4d093b37372777bd76e88862f2b9168d8
parent 26060 b212707c7347b8edae03d949378fe01e1a8b587d
child 26062 6ae174e4b229203499e51112c7386b2a948e7942
push id1850
push userclokep@gmail.com
push dateWed, 08 Mar 2017 19:29:12 +0000
treeherdercomm-esr52@028df196b2d9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmkmelin, rkent
bugs1166206
Bug 1166206 - Use makeFromDisplayAddress in setting Compose from field, r=mkmelin, a=rkent
mail/components/compose/content/MsgComposeCommands.js
--- a/mail/components/compose/content/MsgComposeCommands.js
+++ b/mail/components/compose/content/MsgComposeCommands.js
@@ -2438,17 +2438,19 @@ function DoSpellCheckBeforeSend()
  * Handles message sending operations.
  * @param msgType nsIMsgCompDeliverMode of the operation.
  */
 function GenericSendMessage(msgType)
 {
   var msgCompFields = gMsgCompose.compFields;
 
   Recipients2CompFields(msgCompFields);
-  msgCompFields.from = GetMsgIdentityElement().value;
+  let addresses = MailServices.headerParser
+                              .makeFromDisplayAddress(GetMsgIdentityElement().value);
+  msgCompFields.from = MailServices.headerParser.makeMimeHeader(addresses, 1);
   var subject = GetMsgSubjectElement().value;
   msgCompFields.subject = subject;
   Attachments2CompFields(msgCompFields);
   // Some other msgCompFields have already been updated instantly in their respective
   // toggle functions, e.g. ToggleReturnReceipt(), ToggleDSN(),  ToggleAttachVCard(),
   // and toggleAttachmentReminder().
 
   let sending = msgType == nsIMsgCompDeliverMode.Now ||