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.
Comment on attachment 363018
Adds DisplayName generation to text-based import.
>+#define PREF_MAIL_ ADDR_BOOK_ DISPLAYNAME_ AUTOGENERATION "mail.addr_ book.displayNam e.autoGeneratio n"
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( )) { FindChar( '@'); SetLength( index);
>+ // 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.
>+ if (index != -1)
>+ displayName.
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.