Browse Source

Allow access to addressbook unique uri

Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Co-Authored-By: Joas Schilling <coding@schilljs.com>
tags/v16.0.0alpha1
John Molakvoæ (skjnldsv) 5 years ago
parent
commit
22112bf71d
No account linked to committer's email address

+ 9
- 0
apps/dav/lib/CardDAV/AddressBookImpl.php View File

@@ -75,6 +75,15 @@ class AddressBookImpl implements IAddressBook {
return $this->addressBookInfo['id'];
}

/**
* @return string defining the unique uri
* @since 16.0.0
* @return string
*/
public function getUri(): string {
return $this->addressBookInfo['uri'];
}

/**
* In comparison to getKey() this function returns a human readable (maybe translated) name
*

+ 16
- 0
lib/private/ContactsManager.php View File

@@ -119,7 +119,12 @@ namespace OC {
}

/**
* Return a list of the user's addressbooks display names
* ! The addressBook displayName are not unique, please use getUserAddressBooks
*
* @return array
* @since 6.0.0
* @deprecated 16.0.0 - Use `$this->getUserAddressBooks()` instead
*/
public function getAddressBooks() {
$this->loadAddressBooks();
@@ -131,6 +136,17 @@ namespace OC {
return $result;
}

/**
* Return a list of the user's addressbooks
*
* @return IAddressBook[]
* @since 16.0.0
*/
public function getUserAddressBooks(): Array {
$this->loadAddressBooks();
return $this->addressBooks;
}

/**
* removes all registered address book instances
*/

+ 12
- 0
lib/public/Contacts/IManager.php View File

@@ -154,13 +154,25 @@ interface IManager {
public function register(\Closure $callable);

/**
* Return a list of the user's addressbooks display names
*
* @return array
* @since 6.0.0
* @deprecated 16.0.0 - Use `$this->getUserAddressBooks()` instead
*/
public function getAddressBooks();

/**
* Return a list of the user's addressbooks
*
* @return IAddressBook[]
* @since 16.0.0
*/
public function getUserAddressBooks();

/**
* removes all registered address book instances
*
* @return void
* @since 6.0.0
*/

+ 7
- 0
lib/public/IAddressBook.php View File

@@ -45,6 +45,13 @@ namespace OCP {
*/
public function getKey();

/**
* @return string defining the unique uri
* @since 16.0.0
* @return string
*/
public function getUri(): string;

/**
* In comparison to getKey() this function returns a human readable (maybe translated) name
* @return mixed

Loading…
Cancel
Save