allow sharing addressbooks with circles
Signed-off-by: Georg Ehrke <developer@georgehrke.com>
This commit is contained in:
parent
5e37b52241
commit
34601f8623
|
@ -167,8 +167,10 @@ class CardDavBackend implements BackendInterface, SyncSupport {
|
|||
}
|
||||
$result->closeCursor();
|
||||
|
||||
// query for shared calendars
|
||||
// query for shared addressbooks
|
||||
$principals = $this->principalBackend->getGroupMembership($principalUriOriginal, true);
|
||||
$principals = array_merge($principals, $this->principalBackend->getCircleMembership($principalUriOriginal));
|
||||
|
||||
$principals = array_map(function($principal) {
|
||||
return urldecode($principal);
|
||||
}, $principals);
|
||||
|
|
|
@ -426,13 +426,12 @@ class Principal implements BackendInterface {
|
|||
* @return array
|
||||
* @throws Exception
|
||||
*/
|
||||
public function getCircleMembership($principal) {
|
||||
public function getCircleMembership($principal):array {
|
||||
if (!\OC::$server->getAppManager()->isEnabledForUser('circles') || !class_exists('\OCA\Circles\ShareByCircleProvider')) {
|
||||
return [];
|
||||
}
|
||||
|
||||
list($prefix, $name) = \Sabre\Uri\split($principal);
|
||||
|
||||
if ($this->hasCircles && $prefix === $this->principalPrefix) {
|
||||
$user = $this->userManager->get($name);
|
||||
if (!$user) {
|
||||
|
|
Loading…
Reference in New Issue