CardDAV Address Book

Since 1.10.0 each site’s members are also available as a read-only CardDAV address book, so staff can sync the whole club into their phone or desktop contacts instead of downloading cards. It replaced the separate LH CardDAV Server plugin, which was retired. A synced card is built by the same code as a downloaded one, so both always carry the same data.

Setting it up

You need the capability that shows vCard links (publish_posts by default) and an application password (Users → Profile → Application Passwords). Your normal account password is not accepted.

Apps find the address book on their own through /.well-known/carddav. If one does not, give it the full address: the site’s domain followed by /carddav/.

What is in it

How syncing works

The first sync sends every card. After that, clients use sync-collection (RFC 6578) and receive only the cards that changed, plus deletions for members who left the site or were blocked. A card counts as changed when its REV (last-changed time on that site) moves, which happens on changes to tracked user meta, email, display name, BuddyPress profile fields, the avatar, group membership, or a group’s name or status. Removals are remembered for 90 days; a client whose sync token is older than that is asked to start again with a full sync.

ETags, the collection CTag and sync tokens include a hash of which hidden groups the syncing user can see, and the plugin version, so a change in either refreshes that user’s cards.

Architecture

Download tokens now carry the viewer as well: {expiry}.{viewer_id}.{hmac}. Tokens from before 1.10.0 ({expiry}.{hmac}) are still accepted until they expire, as a viewer who sees no hidden groups.