Bug 309057 - Port |
Bug 240138 - Show just the name and not the email address in the message pane| to SeaMonkey; then
bug 381555 and
bug 243631; (Hv2)
bug 243631; r=iann_bugzilla sr=neil aSM2.0a1=iann_bugzilla
--- a/mailnews/base/resources/content/msgHdrViewOverlay.js
+++ b/mailnews/base/resources/content/msgHdrViewOverlay.js
@@ -1033,31 +1033,31 @@ function updateEmailAddressNode(emailAdd
// If the email address is found in any of the address books,
// then consider this user a 'known' user and use the display name.
function AddExtraAddressProcessing(emailAddress, addressNode)
{
if (!gShowCondensedEmailAddresses)
return;
+ // Get the id of the mail-multi-emailHeaderField binding parent.
+ var parentElementId = addressNode.parentNode.parentNode.parentNode.id;
+ // Don't condense the address for the from and reply-to fields.
+ // Ids: "collapsedfromValue", "expandedfromBox", "expandedreply-toBox".
+ if (/^(collapsedfromValue|expanded(from|reply-to)Box)$/.test(parentElementId))
+ return;
+
// TODO: Maybe do domain matches too (i.e. any email from someone in my
// company should use the friendly display name).
- const displayName = addressNode.getAttribute("displayName");
- if (!(displayName && getCardForAddress(emailAddress)))
+ var card = getCardForAddress(emailAddress);
+ if (!(card && card.displayName))
return;
- // Get the id of the mail-multi-emailHeaderField binding parent.
- var parentElementId = addressNode.parentNode.parentNode.parentNode.id;
- // Don't condense the address for the from and reply-to fields.
- if (parentElementId == "expandedfromBox" ||
- parentElementId == "expandedreply-toBox")
- return;
-
- addressNode.setAttribute("label", displayName);
+ addressNode.setAttribute("label", card.displayName);
addressNode.setAttribute("tooltiptext", emailAddress);
}
function fillEmailAddressPopup(emailAddressNode)
{
document.getElementById("emailAddressPlaceHolder")
.setAttribute("label", emailAddressNode.getAttribute("emailAddress"));
}