I am developing a synchronization interface for Thunderbird.
Works well on Thunderbird 2, and I am now trying to port to
Thunderbird 3.
I need a unique key for each address-card.
This key will be stored by my application and later I need to be able
to find the address-card based on this unique key.
nsIAbCard does not seem to offer such a feature.
Does anybody have any suggestions as how to get a unique key which can
later be used to retrieve the card?
(Note that I cannot just use some of the user-defined fields or a hash
of all fields or similar, as the user may change the info on the card
at will, and I still need to find the same card)
Thanks in advance for any help...
/Henrik
This has been discussed but not resolved yet:
https://bugzilla.mozilla.org/show_bug.cgi?id=444093
Standard8
By Thunderbird 3, a UUID will be provided for each card; the feature was
supposed to have been added with the first patch on bug 413260 but was
pulled late in the review cycle due to an unresolved disagreement. I
currently have UUIDs set up and working for Outlook and LDAP address
books in my ab_rewrite repo:
<http://hg.mozilla.org/users/Pidgeot18_gmail.com/ab_rewrite/> (be sure
to use the bug444093 branch...).
> Does anybody have any suggestions as how to get a unique key which can
> later be used to retrieve the card?
If you know the source of a card, you could use the UUID of the source
for the time being: DN for LDAP cards, DbRowID for MDB cards,
OutlookEntryURI for Outlook cards, and the RDF value (from
nsIRDFResource) for OS X cards (I'm not sure about that last one).
Thank you for your help!
Guess I will stick to DbRowID for now (like I do for TBird 2) and
watch for 444093 to be resolved (as I don't like the dependency on MDB
but would like to stick to nsIAbCard)
/Henrik
Well, building Thunderbid (dynamic linking) from Comm-central source
code
(Mercurial) does not include nsIAbMDBCard.h in dist/include/addrbook
anymore.
Is this "just" a bug in the current building code, or is this
interface being dropped, or ???
/Henrik
The interface has been dropped due to its functions having been
superseded by the new nsIAbCard (and the eventual disappearance of MDB
address books altogether).
Ahh...
But then: How do I get a unique ID on a card ???
/Henrik
Might this also be the reason that the following fails with
0x0cf130001 (although it works in Tbird2):
nsCOMPtr<nsIRDFService> rdfService;
rdfService=do_GetService("@mozilla.org/rdf/rdf-service;1", &rv);
nsCOMPtr<nsIRDFResource> rs;
gchar *szAB=g_strconcat("moz-abmdbdirectory://", sz, NULL);
nsCString csc;
NS_CStringSetData(csc, szAB);
rdfService->GetResource(csc, getter_AddRefs(rs));
nsCOMPtr<nsIAbDirectory> myAbDirectory;
myAbDirectory = do_QueryInterface(rs, &rv);
rv <- 0x0cf130001
If yes, my Q remains: