Comment 17 for bug 600755

Revision history for this message
In , Bugzilla-standard8 (bugzilla-standard8) wrote :

Comment on attachment 363018
Adds DisplayName generation to text-based import.

>+#define PREF_MAIL_ADDR_BOOK_DISPLAYNAME_AUTOGENERATION "mail.addr_book.displayName.autoGeneration"

I think we should expose this in the import UI. Some people may not have display names, and prefer not to generate them, I've just cc'ed our user-experience guy in case he disagrees.

>+ case 2:
>+ hasDisplayName = PR_TRUE;
>+ break;

What about the case where the user has chosen to import an existing address book, but hasn't got a display name in some/all rows?

>+ } else if (!primaryEmail.IsEmpty()) {
>+ // see bug #211078
>+ // if there is no generated name at this point
>+ // use the userid from the email address
>+ // it is better than nothing.
>+ displayName = primaryEmail;
>+ PRInt32 index = displayName.FindChar('@');
>+ if (index != -1)
>+ displayName.SetLength(index);

I'm not sure we want to copy this clause. If we haven't got a first/last name then I think generating one from the email in this case isn't such a good idea, and we should just give up.