Closed Bug 211078 Opened 21 years ago Closed 21 years ago

addressbook views shows blank name field, when we could use email address

Categories

(SeaMonkey :: MailNews: Address Book & Contacts, defect)

x86
Windows XP
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
mozilla1.5alpha

People

(Reporter: mscott, Assigned: sspitzer)

Details

Attachments

(1 file, 1 obsolete file)

If we collect an address that contains just an email address, we don't auto
create a generated display name with the newly generated address book card.

i.e. if the address is just "dallas-mavericks@dallasfan.com"

we generate a collected ab card with a blank name. 

I believe we should be striping the text before the @ sign off and making that
the generated display name. i.e. 'dallas-mavericks'.

This will make the contact manager in the compose window for thunderbird much
more useful because you want have a huge number of cards without blank name
fields. You will have some useful text to look at.
curious, do you get any email back, from dallas-mavericks@dallasfan.com?

we've got to code so that when the email arrives from someone in the addressbook
you use for collecting, and there is no display name, we'll set it.

See nsAbAddressCollecter::SetNamesForCard()

Is the issue that with dallas-mavericks@dallasfan.com, because it's a mailing
list and there is no display name, we never collect anything?

Here's another approach, that will work for existing users, who might have blank
entries in their PAB already.

Fix nsAddrBookSession::GenerateNameFromCard(), so that if we are about to return
"" as the generated name, you use the userid (from the primary email) instead,
and if not that, maybe the secondary email or the screenname.

this way, you won't have to touch the collection code.

what do you think?
When the compose window collects an address, it just calls:

nsAbAddressCollecter::CollectAddress 

which never calls SetNamesForCard in the case of a new entry:

    if (!existingCard && aCreateCard)
    {
      nsCOMPtr<nsIAbCard> senderCard =
do_CreateInstance(NS_ABCARDPROPERTY_CONTRACTID, &rv);
      if (NS_SUCCEEDED(rv) && senderCard)
      {
        PRBool modifiedCard;
        if (curName && *curName) {
          rv = SetNamesForCard(senderCard, curName, &modifiedCard);
          NS_ASSERTION(NS_SUCCEEDED(rv), "failed to set names");
        }

If I type "foobar@foo.com" into the compose window and hit send, I get an ab
card with an empty generated name. 
later, when you get mail back from that sender, is when we'd collect.

or, that's how it's supposed to work (and used to work)
"is when we'd collect", I meant "is when we'd collect the display name"
Attached patch patch (obsolete) — Splinter Review
taking, since I have the fix.
Assignee: scott → sspitzer
Summary: collected address has blank name field → addressbook views shows blank name field, when we could use email address
Target Milestone: --- → mozilla1.5alpha
fixed.

the place to see this on the trunk is if you are viewing an addressbook by
display name, and you don't have display names.

we will now show the userid from the email addresses (or if no @ symbol, the
whole thing).
Status: NEW → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
Product: Browser → Seamonkey
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: