Bug 1152045 From address missing if the identityName pref is set r=mkmelin, a=rkent
authorNeil Rashbrook <neil@parkwaycc.co.uk>
Sat, 18 Apr 2015 00:32:56 +0100
changeset 25857 ec4c11836db9aa3729b82dba62ebd65571f2d589
parent 25856 53b37cdf7e7418848c661623b440cbe7ea51d040
child 25858 73b80ca7e276844113d857f78fcd8edcce745f8f
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
bugs1152045
Bug 1152045 From address missing if the identityName pref is set r=mkmelin, a=rkent 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,20 @@ function FillIdentityList(menulist)
         menulist.menupopup.appendChild(separator);
       }
       accountHadSeparator = needSeparator;
     }
     firstAccountWithIdentities = false;
 
     for (let i = 0; i < identities.length; i++) {
       let identity = identities[i];
+      let address = MailServices.headerParser.makeMailboxObject(
+        identity.fullName, identity.email).toString();
       let item = menulist.appendItem(identity.identityName,
-                                     identity.identityName,
+                                     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 address = MailServices.headerParser
+                                .makeMailboxObject(identity.fullName,
+                                                   identity.email).toString();
       let item = menulist.appendItem(identity.identityName,
-                                     identity.identityName,
+                                     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");
       }
@@ -2375,16 +2379,18 @@ function DetermineConvertibility()
 }
 
 function LoadIdentity(startup)
 {
     var identityElement = GetMsgIdentityElement();
     var prevIdentity = gCurrentIdentity;
 
     if (identityElement) {
+        identityElement.value = identityElement.selectedItem.value;
+
         var idKey = identityElement.selectedItem.getAttribute("identitykey");
         gCurrentIdentity = gAccountManager.getIdentity(idKey);
 
         let accountKey = null;
         if (identityElement.selectedItem)
           accountKey = identityElement.selectedItem.getAttribute("accountkey");
 
         let maxRecipients = awGetMaxRecipients();