summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorJohn Molakvoæ <skjnldsv@users.noreply.github.com>2019-01-22 13:00:07 +0100
committerGitHub <noreply@github.com>2019-01-22 13:00:07 +0100
commitb1d4c3f50b00457c1ac10949df4ed5cf9adc9906 (patch)
tree0c8a0c12cc59bcb4c1dfee8e60d303d543c074c1 /lib
parent5f61fafaaa41d80f32093af06f3da79ab218c63b (diff)
parent22112bf71d7e43f57b6987ed35200a99472ea4d6 (diff)
downloadnextcloud-server-b1d4c3f50b00457c1ac10949df4ed5cf9adc9906.tar.gz
nextcloud-server-b1d4c3f50b00457c1ac10949df4ed5cf9adc9906.zip
Merge pull request #13642 from nextcloud/contacts-menu-url-fix
Allow access to addressbook unique uri
Diffstat (limited to 'lib')
-rw-r--r--lib/private/ContactsManager.php16
-rw-r--r--lib/public/Contacts/IManager.php12
-rw-r--r--lib/public/IAddressBook.php7
3 files changed, 35 insertions, 0 deletions
diff --git a/lib/private/ContactsManager.php b/lib/private/ContactsManager.php
index 6a83a718d41..e279997e634 100644
--- a/lib/private/ContactsManager.php
+++ b/lib/private/ContactsManager.php
@@ -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();
@@ -132,6 +137,17 @@ namespace OC {
}
/**
+ * 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
*/
public function clear() {
diff --git a/lib/public/Contacts/IManager.php b/lib/public/Contacts/IManager.php
index ec399c37eb4..e744a92d9e2 100644
--- a/lib/public/Contacts/IManager.php
+++ b/lib/public/Contacts/IManager.php
@@ -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
*/
diff --git a/lib/public/IAddressBook.php b/lib/public/IAddressBook.php
index 4739e6f0c5b..c666311ffb2 100644
--- a/lib/public/IAddressBook.php
+++ b/lib/public/IAddressBook.php
@@ -46,6 +46,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
* @since 5.0.0