From 0707a51eaddec22ab760e27050e2fcefab2cdae5 Mon Sep 17 00:00:00 2001 From: "Matt A. Tobin" Date: Mon, 11 Nov 2019 01:04:46 -0500 Subject: Bug 1423487 - Support multiple authors in RSS feeds. Tag #1273 --- mailnews/base/src/nsMsgDBView.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'mailnews/base') diff --git a/mailnews/base/src/nsMsgDBView.cpp b/mailnews/base/src/nsMsgDBView.cpp index 76a843df72..a1867244ba 100644 --- a/mailnews/base/src/nsMsgDBView.cpp +++ b/mailnews/base/src/nsMsgDBView.cpp @@ -400,10 +400,12 @@ nsresult nsMsgDBView::FetchAuthor(nsIMsgDBHdr * aHdr, nsAString &aSenderString) nsCString headerCharset; aHdr->GetEffectiveCharset(headerCharset); - nsCString emailAddress; nsString name; - ExtractFirstAddress(EncodedHeader(author, headerCharset.get()), name, - emailAddress); + nsCString emailAddress; + nsCOMArray addresses = EncodedHeader(author, headerCharset.get()); + bool multipleAuthors = addresses.Length() > 1; + + ExtractFirstAddress(addresses, name, emailAddress); if (showCondensedAddresses) GetDisplayNameInAddressBook(emailAddress, aSenderString); @@ -429,6 +431,12 @@ nsresult nsMsgDBView::FetchAuthor(nsIMsgDBHdr * aHdr, nsAString &aSenderString) } } + if (multipleAuthors) + { + aSenderString.AppendLiteral(" "); + aSenderString.Append(GetString(u"andOthers")); + } + UpdateCachedName(aHdr, "sender_name", aSenderString); return NS_OK; -- cgit v1.2.3