Closed Bug 53216 Opened 24 years ago Closed 22 years ago

AB:Display names typed into Mailing list disappear after closing

Categories

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

x86
Windows NT
defect

Tracking

(Not tracked)

VERIFIED FIXED
mozilla1.4alpha

People

(Reporter: marina, Assigned: shliang)

References

Details

(Whiteboard: [adt2] nab-mlist)

Attachments

(1 file, 2 obsolete files)

**** observed with 2000-09-19-09 build ****
Steps to reproduce:
- Edit existing Mailing List by typing into it new names (Display Name followed 
by email address for ex: alex smith <iqawin1@netscape.com>);
- close Mailing list by OK'ing it;
- re-open it (or send Mail, get it and observe):
//note: all Display Names that you typed into the List are stripped off leaving 
the email addresses only
Is this a regression?
The display name should be entered through New Card or Edit Card.  Mailing list 
dialog only get the email address from the mailing list.  It is not a 
regression.
In that case we have to language it differently , now when when you open a 
Mailing List it says : type names or drag/drop addresses into the Mailing list 
below". Type names could be understood as a possibilty to enter Display names 
there
QA Contact: esther → suresh
Possibly a dupe of 46058?
Yes, basically is the same.  Mailing list dialog doesn't pasre the entered 
string to get the display name if there's one. 
Status: NEW → ASSIGNED
QA Contact: suresh → pmock
reassigning to chuang.
Assignee: putterman → chuang
Status: ASSIGNED → NEW
QA-assign-to fenella.
QA Contact: pmock → fenella
QA Contact: fenella → nbaca
reassigning to racham.
Assignee: chuang → racham
Status: NEW → ASSIGNED
Target Milestone: --- → mozilla0.9.9
What is the solution for this bug? Are we going to allow Display Names when
creating a list or does the text need to change in the dialog?

Marking nsbeta1 because it should be more clear.
Keywords: nsbeta1
Whiteboard: nab-mlist
Keywords: nsbeta1nsbeta1+
Priority: P3 → P2
I definitely think you should be able to type in whatever name you want when 
creating or editing a mailing list. This is a bug and not a feature. :-)
Blocks: 122274
Keywords: nsbeta1+nsbeta1-
Target Milestone: mozilla0.9.9 → mozilla1.2
No longer blocks: 122274
Blocks: 136757
Marking nsbeta1 so that the Display Name is retained.
Keywords: nsbeta1-nsbeta1
Mail triage team: nsbeta1+/adt2
Keywords: nsbeta1nsbeta1+
Whiteboard: nab-mlist → [adt2] nab-mlist
Reassigning.
Assignee: racham → cavin
Status: ASSIGNED → NEW
Reassigning.
Assignee: cavin → shliang
Attached patch patch (obsolete) — Splinter Review
Attachment #113042 - Flags: superreview?(sspitzer)
Attachment #113042 - Flags: review?(cavin)
Comment on attachment 113042 [details] [diff] [review]
patch

r=cavin.
Attachment #113042 - Flags: review?(cavin) → review+
Attached patch patch (obsolete) — Splinter Review
Attachment #113042 - Attachment is obsolete: true
Attachment #113042 - Flags: superreview?(sspitzer)
Attachment #113042 - Flags: review+
Attachment #113255 - Flags: superreview?(sspitzer)
Attachment #113255 - Flags: review?(cavin)
Comment on attachment 113255 [details] [diff] [review]
patch

r=cavin.
Attachment #113255 - Flags: review?(cavin) → review+
Comment on attachment 113255 [details] [diff] [review]
patch

1)

+    nsXPIDLString name;
+    pCard->GetDisplayName(getter_Copies(name));
+    if (name) {
+      AddDisplayName(pCardRow, NS_ConvertUCS2toUTF8(name).get());
+      err = m_mdbPabTable->AddRow(GetEnv(), pCardRow);
+    }

Because name is a nsXPIDLString, I think you want:

if (!name.IsEmpty()) {

instead of 

if (name) {

2)

What happens if the user add a display name to an email address that was
already in the list?
(does your code do the right thing?)

3)

+	   if (beginpos != 0) {
+	     var name = fieldValue.slice(0, beginpos - 1);
+	     cardproperty.displayName = name;
+	   }

actually, the whole "if (cardproperty) {}" block (which you are adding to) has
a problem.

we are parsing the line by hand, and we need to use the header parser.	

(there can be escaped characters and other things that simple parsing won't
catch.)

here's the start of what I think we should do:

var gMsgHeaderParser =
Components.classes["@mozilla.org/messenger/headerparser;1"].getService(Componen
ts.interfaces.nsIMsgHeaderParser);

...

if (cardproperty)
{
  var numAddresses = gMsgHeaderParser.parseHeadersWithArray(emailAddresses,
addresses, names, fullNames);
  var addresses = {};
  var fullNames = {};	
  var names = {};
  var numAddresses = msgHeaderParser.parseHeadersWithArray(fieldValue,
addresses, names, fullNames);
  // numAddresses should always be 1, right?
  cardproperty.primaryEmail = addresses.value[0];
  cardproperty.displayName = names.value[0];

  if (doAdd || (doAdd == false && pos >= oldTotal))
    mailList.addressLists.AppendElement(cardproperty);
  pos++;
}

can you try that out?  
numAddresses should be 1, but might not be if the line is blank 
or if the user does something like "foo@bar.com,cheese@test.com" on a line.

Can you investigate?
Attachment #113255 - Flags: superreview?(sspitzer) → superreview-
Attached patch patchSplinter Review
2. What happens if the user add a display name to an email address that was
already in the list? (does your code do the right thing?)
yes this works.

3. using the msg header parser now, in most cases numAddresses is 1, otherwise
only the first one entered in the line is added.
Attachment #113255 - Attachment is obsolete: true
Target Milestone: mozilla1.2alpha → mozilla1.4alpha
Comment on attachment 113635 [details] [diff] [review]
patch

sr=sspitzer, thanks shuehan
Attachment #113635 - Flags: superreview+
Attachment #113635 - Flags: review+
marking fixed.
Status: NEW → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
Trunk build 2003-03-03: WinXP, Linux RH 8

These are the results so far. I'm not sure If this is what is expected:

1. In a list dialog type a display name followed by an email address and it is
retained after closing/reopening the list (i.e. John Smith <smith@test.com>)

2a. In a list dialog type two address one one line, separated by a comma and
only the first address remains (i.e. test1@ns.com, test2@ns.com --> results in
test1@ns.com remaining but test2@ns.com is gone)

2b. Performed the same test as 2a except these entries include the display name
and only the first display name/email address is retained (i.e. John Smith
<test1@ns.com>, John Smith2 <test2@ns.com> --> results in John Smith
<test1@ns.com> remaining but John Smith2 <test2@ns.com> is gone)
Verified Fixed. I checked with shliang and this is the expected behavior.
Status: RESOLVED → VERIFIED
Product: Browser → Seamonkey
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: