diff options
author | Johannes Merkel <mail@johannesgge.de> | 2023-05-22 15:25:16 +0200 |
---|---|---|
committer | backportbot-nextcloud[bot] <backportbot-nextcloud[bot]@users.noreply.github.com> | 2023-08-16 10:47:40 +0000 |
commit | 8dae579261f23263231b77990ae79965efa61dc0 (patch) | |
tree | c5773caff086511fa5ddd698b6bfc99b65f95463 /apps/dav/lib/DAV | |
parent | 5af9b6cb99313b6572bd669dc1914693c90378b1 (diff) | |
download | nextcloud-server-8dae579261f23263231b77990ae79965efa61dc0.tar.gz nextcloud-server-8dae579261f23263231b77990ae79965efa61dc0.zip |
enh(contacts): show/hide addressbooks for all
Signed-off-by: Johannes Merkel <mail@johannesgge.de>
Diffstat (limited to 'apps/dav/lib/DAV')
-rw-r--r-- | apps/dav/lib/DAV/CustomPropertiesBackend.php | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/apps/dav/lib/DAV/CustomPropertiesBackend.php b/apps/dav/lib/DAV/CustomPropertiesBackend.php index bc822aee974..989d049fbd1 100644 --- a/apps/dav/lib/DAV/CustomPropertiesBackend.php +++ b/apps/dav/lib/DAV/CustomPropertiesBackend.php @@ -179,6 +179,21 @@ class CustomPropertiesBackend implements BackendInterface { } } + // substr of addressbooks/ => path is inside the CardDAV component + // three '/' => this a addressbook (no addressbook-home nor contact object) + if (str_starts_with($path, 'addressbooks/') && substr_count($path, '/') === 3) { + $allRequestedProps = $propFind->getRequestedProperties(); + $customPropertiesForShares = [ + '{DAV:}displayname', + ]; + + foreach ($customPropertiesForShares as $customPropertyForShares) { + if (in_array($customPropertyForShares, $allRequestedProps, true)) { + $requestedProps[] = $customPropertyForShares; + } + } + } + if (empty($requestedProps)) { return; } |