Bug 1152045 - Email address missing from "From" field on emails sent if the identityName pref was set. r=mkmelin, a=rkent, a=Callek for SeaMonkey CLOSED TREE
☠☠ backed out by 7cb2c130de12 ☠ ☠
authorNeil Rashbrook <neil@parkwaycc.co.uk>
Tue, 14 Apr 2015 22:44:06 +0200
changeset 25846 9d0181083ebb5cc609d04d72acf5d81817b6e2c2
parent 25845 662ccf7959bc45723bbeb9c78c3823624f218c53
child 25847 493df50681a3e8f3fffd7a749bed3d4ca682da82
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, Callek
bugs1152045
Bug 1152045 - Email address missing from "From" field on emails sent if the identityName pref was set. r=mkmelin, a=rkent, a=Callek for SeaMonkey CLOSED TREE
mail/components/compose/content/MsgComposeCommands.js
suite/mailnews/compose/MsgComposeCommands.js
--- a/mail/components/compose/content/MsgComposeCommands.js
+++ b/mail/components/compose/content/MsgComposeCommands.js
@@ -3210,18 +3210,21 @@ function FillIdentityList(menulist)
         menulist.menupopup.appendChild(separator);
       }
       accountHadSeparator = needSeparator;
     }
     firstAccountWithIdentities = false;
 
     for (let i = 0; i < identities.length; i++) {
       let identity = identities[i];
-      let item = menulist.appendItem(identity.identityName,
-                                     identity.identityName,
+      let address = MailServices.headerParser
+                                .makeMailboxObject(identity.fullName,
+                                                   identity.email).toString();
+      let item = menulist.appendItem(address,
+                                     address,
                                      account.incomingServer.prettyName);
       item.setAttribute("identitykey", identity.key);
       item.setAttribute("accountkey", account.key);
       if (i == 0) {
         // Mark the first identity as default.
         item.setAttribute("default", "true");
       }
     }
--- a/suite/mailnews/compose/MsgComposeCommands.js
+++ b/suite/mailnews/compose/MsgComposeCommands.js
@@ -1,15 +1,16 @@
 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
  * This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 Components.utils.import("resource:///modules/folderUtils.jsm");
 Components.utils.import("resource:///modules/iteratorUtils.jsm");
+Components.utils.import("resource:///modules/mailServices.js");
 
 /**
  * interfaces
  */
 const nsIMsgCompDeliverMode = Components.interfaces.nsIMsgCompDeliverMode;
 const nsIMsgCompSendFormat = Components.interfaces.nsIMsgCompSendFormat;
 const nsIMsgCompConvertible = Components.interfaces.nsIMsgCompConvertible;
 const nsIMsgCompType = Components.interfaces.nsIMsgCompType;
@@ -1892,18 +1893,21 @@ function FillIdentityList(menulist)
                                          Components.interfaces.nsIMsgIdentity));
 
     if (identities.length == 0)
       continue;
 
     for (let i = 0; i < identities.length; i++)
     {
       let identity = identities[i];
-      let item = menulist.appendItem(identity.identityName,
-                                     identity.identityName,
+      let address = MailServices.headerParser
+                                .makeMailboxObject(identity.fullName,
+                                                   identity.email).toString();
+      let item = menulist.appendItem(address,
+                                     address,
                                      account.incomingServer.prettyName);
       item.setAttribute("identitykey", identity.key);
       item.setAttribute("accountkey", account.key);
       if (i == 0)
       {
         // Mark the first identity as default.
         item.setAttribute("default", "true");
       }