Closed Bug 1637923 Opened 4 years ago Closed 4 years ago

Convert JS address book directory to a JS class

Categories

(MailNews Core :: Address Book, enhancement)

enhancement

Tracking

(Not tracked)

RESOLVED FIXED
Thunderbird 78.0

People

(Reporter: darktrojan, Assigned: darktrojan)

References

Details

Attachments

(1 file)

To get the JS directory type going, and because of the twisted way the address book works, I implemented it as an object and did some "clever" (bonkers) things with prototypes to make it all work. Now that the address book manager is also implemented in javascript and search is done without URI mangling, I can undo a lot of the "clever"ness and simplify everything. This will be helpful for implementing new directory types such as CardDAV.

Attachment #9148311 - Flags: review?(mkmelin+mozilla)
Comment on attachment 9148311 [details] [diff] [review]
1637923-directory-class-1.diff

Review of attachment 9148311 [details] [diff] [review]:
-----------------------------------------------------------------

Thx! r=mkmelin

::: mailnews/addrbook/jsaddrbook/AddrBookDirectory.jsm
@@ +129,3 @@
>    }
>  
> +  init(uri) {

I think  it would be nicer to make the constructor take the uri and drop the init method
Attachment #9148311 - Flags: review?(mkmelin+mozilla) → review+

It would, but we can't do that at this stage. This is still an XPCOM component (and we still have to use it as one in at least one place) and they can't use constructors with arguments.

Pushed by geoff@darktrojan.net:
https://hg.mozilla.org/comm-central/rev/34122197a6a4
Convert JS address book directory to a JS class. r=mkmelin

Status: ASSIGNED → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → Thunderbird 78.0

This will be helpful for implementing new directory types such as CardDAV.

Yay! Thanks for working on this!

I can undo a lot of the "clever"ness and simplify everything

And thanks for cleaning up!
Your work is very appreciated.

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: