Open Bug 314448 Opened 19 years ago Updated 2 years ago

Collecting an address should create specified addressbook

Categories

(MailNews Core :: Address Book, defect)

defect

Tracking

(Not tracked)

People

(Reporter: iannbugzilla, Unassigned)

Details

(Whiteboard: [patchlove])

Attachments

(1 file, 1 obsolete file)

When a new profile is created the two default addressbooks (Personal Address Book and Collected Addresses) are not created. This is not a problem as long as they are created at the right moment e.g. when you add an entry.

Unfortunately they get created even when you do not add an entry (like opening addressbook - bug 66408 or right click and add to addressbook and then cancelling - not sure if there is a bug for this) and not created when they should be (via abAddressCollector - this bug).

http://lxr.mozilla.org/seamonkey/source/mail/base/content/msgHdrViewOverlay.js#427 throws an exception on new profiles instead of creating the relevant addressbook.
Similarly http://lxr.mozilla.org/seamonkey/source/mailnews/base/resources/content/msgHdrViewOverlay.js#386

a try/catch (bug 308988 and bug 312474) lets the headers get displayed but does not allow for addresses to be collected until the addressbook is created.

Hope this makes sense.
Attached patch First draft (obsolete) — Splinter Review
Ok, this is a first draft of fixing this bug - basically, it extends the create flag out to the nsIAddressBook interface which gives much greater control as to whether or not a database file should be created.

It is very much untested, save starting up mozilla twice - once with a new profile once without, and will need more consideration of the effects of changes in each case, so if anyone has time to cast their eyes over it before I get round to updating it next that would be appreciated.
I'm guessing the changes to nsDirPrefs.cpp and nsDirPrefs.h are now already in the tree?
(In reply to comment #2)
> I'm guessing the changes to nsDirPrefs.cpp and nsDirPrefs.h are now already in
> the tree?
> 

Yes, sorry, they crept into this patch by mistake as did the changes to abCardOverlay.js
Attached patch Second draftSplinter Review
This patch doesn't have the extra noise that the first draft did. It still does the same things. For ease of reference the list below shows whether or not we allow creation of the database file based on what we are doing.

* Collecting address -> Create allowed
* Deleting a address book -> No creation allowed
* Checking for a sub directory -> No creation allowed
* Editing a mailing list (I think this is used for "new" ones as well -> Creation allowed
* Checking for address from compose window -> No creation allowed
* Importing address book -> Create allowed
* other cases in nsAbMDBDirectory where it is opening a book -> Create allowed

I still need to check these work as expected, but at least I have a test case list now ;-)
Attachment #202308 - Attachment is obsolete: true
Priority: -- → P4
Product: Core → MailNews Core
Assignee: bugzilla → nobody
Does this still exist?
Priority: P4 → --
Whiteboard: [patchlove]
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.