1
0
mirror of https://github.com/owncloudarchive/contacts.git synced 2024-11-29 11:24:11 +01:00

Merge pull request #987 from gvde/fix-sync-shared-contacts

Fix sync issue of shared address books.
This commit is contained in:
Bernhard Posselt 2015-07-31 16:05:27 +02:00
commit 0e0dfd640d

View File

@ -28,7 +28,8 @@ use OCA\Contacts;
* This class overrides __construct to get access to $addressBookInfo and
* $carddavBackend, \Sabre\CardDAV\AddressBook::getACL() to return read/write
* permissions based on user and shared state and it overrides
* \Sabre\CardDAV\AddressBook::getChild() and \Sabre\CardDAV\AddressBook::getChildren()
* \Sabre\CardDAV\AddressBook::getChild(), \Sabre\CardDAV\AddressBook::getChildren()
* and \Sabre\CardDAV\AddressBook::getMultipleChildren()
* to instantiate \OCA\Contacts\CardDAV\Cards.
*/
class AddressBook extends \Sabre\CardDAV\AddressBook {
@ -229,6 +230,26 @@ class AddressBook extends \Sabre\CardDAV\AddressBook {
}
/**
* This method receives a list of paths in it's first argument.
* It must return an array with Node objects.
*
* If any children are not found, you do not have to return them.
*
* @return array
*/
function getMultipleChildren(array $paths) {
$objs = $this->carddavBackend->getMultipleCards($this->addressBookInfo['id'], $paths);
$children = [];
foreach($objs as $obj) {
# $obj['acl'] = $this->getChildACL();
$children[] = new Card($this->carddavBackend,$this->addressBookInfo,$obj);
}
return $children;
}
/**
* Returns the last modification date as a unix timestamp.
*