Closed Bug 95789 Opened 23 years ago Closed 22 years ago

wrong default domain after selecting different mail account

Categories

(MailNews Core :: Composition, defect, P3)

x86
Other
defect

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: lord, Assigned: vparthas)

References

Details

Attachments

(2 files, 1 obsolete file)

Build: 2001 08 15 04
WinME

I have two mail accounts.  When I compose a new mail message, bug 79053 often
causes the client to select the wrong mail account.  This bug causes the sig and
the From header to be incorrectly set to lord@well.com rather than
lord@netscape.com.

I change the mail account from lord@well.com to lord@netscape.com by clicking on
the From pop-up menu.  (This action triggers bug 95727)

Expected behavior:
When I add recipient email addresses, the mail compose window should assume I
want to auto-complete addresses under my lord@netscape.com profile.  That means
unspecified domains should default to "@netscape.com" and should also use the
Netscape LDAP server for type-down addressing.

Observed behavior:
The client assumes a "@well.com" suffix and does not use the Netscape LDAP server.

When the client correctly selects the lord@netscape.com mail account, things
work as expected.
Blocks: 95791
Might be a dup of one of the bugs you have
QA Contact: sheelar → nbaca
This is stiff a problem using a recent build. We have code to switch the default
domain when you change identity but that seems to be broken. Reassign to varada...
Assignee: ducarroz → varada
Target Milestone: --- → mozilla0.9.9
Status: NEW → ASSIGNED
Keywords: nsbeta1
Target Milestone: mozilla0.9.9 → ---
Blocks: 122274
Keywords: nsbeta1nsbeta1-
Priority: -- → P3
Attached patch Patch V1 (obsolete) — Splinter Review
Regression was caused by moving the code that changed the domain when identity
changed.
Comment on attachment 94683 [details] [diff] [review]
Patch V1

r=ducarroz
Attachment #94683 - Flags: review+
Comment on attachment 94683 [details] [diff] [review]
Patch V1

is this cloned code? if so, could we have a helper routine?
Attached patch Patch V1.1Splinter Review
Moved some common code to another function.
Attachment #94683 - Attachment is obsolete: true
any particular reason you didn't add these two line to the helper routine?

+          if (!gAutocompleteSession)
+            gAutocompleteSession =
Components.classes["@mozilla.org/autocompleteSession;1?type=addrbook"].getService(Components.interfaces.nsIAbAutoCompleteSession);
The two places that we use this are when we change the identity and when we
input in the addressing widget. In the former case (i.e. this bug) we need to
force the domain name check each time whereas in the latter we dont need to do
it if the gAutoCompleteSession already exists. 
if I understand you correctly, then what you could have done is, in the bug
case, nulled out gAutoCompleteSession, and then called the helper routine, which
would look something like this:

function setupAutoComplete()
{
          if (!gAutocompleteSession)
            gAutocompleteSession =
Components.classes["@mozilla.org/autocompleteSession;1?type=addrbook"].getService(Components.interfaces.nsIAbAutoCompleteSession);
  if (gAutocompleteSession)
  {
  var emailAddr = gCurrentIdentity.email;
  var start = emailAddr.lastIndexOf("@");
  gAutocompleteSession.defaultDomain = emailAddr.slice(start + 1,   
emailAddr.length);
}

but I'll leave that up to you.
Comment on attachment 96072 [details] [diff] [review]
Patch V1.1

sr=bienvenu
Attachment #96072 - Flags: superreview+
The reason I didnt do that was because when the setupAutoComplete is called from
oninput in the addressing widget it is better to return if the
gAutocompleteSession already exists. If I nulled it and did the processing again
it would mean that much increase for each input in the addressing widget.
Marking Fixed.
Status: ASSIGNED → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
Buffy Trunk build 2002-10-29: WinMe, Linux 8, Mac 10.1.3
Verified Fixed.
Status: RESOLVED → VERIFIED
Product: MailNews → Core
Product: Core → MailNews Core
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: