Digital Sovereignty for everyone

Service API

LH Contacts has no MCP abilities. Other plugins, including tooling plugins such as LH MCP Contact Abilities, call these methods directly. Methods that return member data check permission inside them, so CardDAV and tooling get the same data under the same rules. Everything works on the current site, so switch to the site first.

LH_Contacts

Method Returns
return_view_capability() The capability to see member contacts (publish_posts by default).
return_signed_download_url( $user_ids, $viewer_id = null ) A signed, expiring download link for one or more users’ cards, built for the viewer (the current user by default). It works for whoever opens it, so check the capability first.
return_members_collection_id() The member address book’s collection ID (members).
plugin_version() The version from the plugin header.

LH_Contacts_Card_Builder

Method Returns
return_card_data( $user_id, $viewer_id = null ) The card’s field array (after lh_contacts_add_data), or an empty array for an unknown user. Does not check the capability.
build_card( $user_id, $viewer_id = null ) The card as vCard 3.0 text, or an empty string. Does not check the capability.
return_user_uid( $user_id ) The card’s stable urn:uuid: UID.
return_viewer_visibility_hash( $viewer_id ) all, public or a hash of the hidden groups the viewer belongs to.

LH_Contacts_Change_Tracker

Method Does
touch_user( $user_id ) Marks the user’s card changed on every site they belong to and records it for syncing phones. Call it when something on the card changes that LH Contacts cannot see, as LH User Identity does for aliases.
return_updated_time( $user_id, $blog_id = null ) The card’s last-changed time on a site.
return_blocked_user_ids() Users blocked on the current site.

LH_Contacts_Members_Provider

The member address book. Get an instance from the providers LH DAV has registered, or create one with new LH_Contacts_Members_Provider() once LH Contacts has booted. These methods check the capability themselves.

Method Returns
user_can_read( $user_id ) Whether the user may read the member book on this site.
get_collections( $user_id ) The member book’s description, or an empty array if the user cannot read it.
get_resource_index( $collection_id, $user_id ) Resource name => ETag for every card, or a WP_Error (404 unknown collection, 403 no access).
get_resources( $collection_id, $names, $user_id ) Resource name => vCard text, built for that user. Unknown names are left out.
put_resource(), delete_resource() Always a 403 WP_Error: the member book is read-only.
return_member_ids() IDs in the member book on this site.
return_resource_name( $user_id ), return_user_id_from_name( $name ) Convert between a user ID and {user ID}.vcf.

If you like this plugin please consider making a donation to further development

Install LHero.org

lhero.org

Open it straight from your home screen, full screen and quicker to load.

  1. Tap the Share button . If you cannot see it, tap ••• first.
  2. Scroll down and tap Add to Home Screen.
  3. Tap Add.
  1. Tap the browser menu â‹®.
  2. Tap Install app or Add to Home screen.
  1. In the menu bar, choose File, then Add to Dock.

Use your browser's menu to install this site or add it to your home screen.