Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

TB address book and mailinglists

13 views
Skip to first unread message

John Bieling

unread,
Aug 4, 2016, 11:33:33 AM8/4/16
to dev-ext...@lists.mozilla.org
Hi, I am searching for help on TB mailinglists. I know a few things
about nsIAbDirectory and nsIAbCard and worked on TB address book in
general, but fail to understand mailinglist. I think cards in
mailinglists are linked to cards in the containing address book, but

1. how do I get the parent address book of a mailinglist?
2. how do i link/add an existing card of an address book to a mailinglist?

Thanks
John

gNeandr

unread,
Aug 10, 2016, 6:12:16 PM8/10/16
to

John Bieling

unread,
Aug 11, 2016, 6:14:18 AM8/11/16
to dev-ext...@lists.mozilla.org
Thanks for your reply.

I did get issue #2 working now and I am able to link existing contacts
into a list. But I still have not found information for issue #1 (get
parent AB of list)

Is it save to search for the last "/" in the url of the list and cut the
"MailinglistXY" off the url and use that as the url of the parent AB? It
is working for me, but will it always work? Are there corner cases,
where this might fail?

Thanks
John
> _______________________________________________
> dev-extensions mailing list
> dev-ext...@lists.mozilla.org
> https://lists.mozilla.org/listinfo/dev-extensions

gNeandr

unread,
Aug 11, 2016, 7:13:02 AM8/11/16
to
Just two two calls which to get the parent details:

> selectedABURI = GetSelectedDirectory();
> selectedABURI :: "moz-abmdbdirectory://abook.mab/MailList2"
>
> cDirectory = GetDirectoryFromURI(selectedABURI).dirName;
> cDirectory :: "Name of MailList2"

So the 'parent dir' in this example is "moz-abmdbdirectory://abook.mab/"

John Bieling

unread,
Aug 12, 2016, 6:51:40 AM8/12/16
to dev-ext...@lists.mozilla.org
Hi,

I think I found the correct answer, it is the function

GetParentDirectoryFromMailingListURI(uri)

This is what I have to do:

selectedABURI = GetSelectedDirectory();
selectedABURI :: "moz-abmdbdirectory://abook.mab/MailList2"

parentABURI = GetParentDirectoryFromMailingListURI(selectedABURI);
parentABURI :: "moz-abmdbdirectory://abook.mab"

And this function is indeed doing a little more than just cutting of the
MailLIst2:
https://dxr.mozilla.org/comm-central/source/suite/mailnews/addrbook/abCommon.js

Thanks for pointing me in the right direction.

John
0 new messages