summaryrefslogtreecommitdiffstats
path: root/apps/dav/lib
diff options
context:
space:
mode:
Diffstat (limited to 'apps/dav/lib')
-rw-r--r--apps/dav/lib/CardDAV/AddressBookImpl.php29
1 files changed, 23 insertions, 6 deletions
diff --git a/apps/dav/lib/CardDAV/AddressBookImpl.php b/apps/dav/lib/CardDAV/AddressBookImpl.php
index 6ec3fed8276..02dc7c5d015 100644
--- a/apps/dav/lib/CardDAV/AddressBookImpl.php
+++ b/apps/dav/lib/CardDAV/AddressBookImpl.php
@@ -281,12 +281,7 @@ class AddressBookImpl implements IAddressBook {
}
}
- if (
- $this->addressBookInfo['principaluri'] === 'principals/system/system' && (
- $this->addressBookInfo['uri'] === 'system' ||
- $this->addressBookInfo['{DAV:}displayname'] === $this->urlGenerator->getBaseUrl()
- )
- ) {
+ if ($this->isSystemAddressBook()) {
$result['isLocalSystemBook'] = true;
}
return $result;
@@ -309,4 +304,26 @@ class AddressBookImpl implements IAddressBook {
return null;
}
+
+ /**
+ * @inheritDoc
+ */
+ public function isShared(): bool {
+ if (!isset($this->addressBookInfo['{http://owncloud.org/ns}owner-principal'])) {
+ return false;
+ }
+
+ return $this->addressBookInfo['principaluri']
+ !== $this->addressBookInfo['{http://owncloud.org/ns}owner-principal'];
+ }
+
+ /**
+ * @inheritDoc
+ */
+ public function isSystemAddressBook(): bool {
+ return $this->addressBookInfo['principaluri'] === 'principals/system/system' && (
+ $this->addressBookInfo['uri'] === 'system' ||
+ $this->addressBookInfo['{DAV:}displayname'] === $this->urlGenerator->getBaseUrl()
+ );
+ }
}