diff options
author | Georg Ehrke <developer@georgehrke.com> | 2016-06-21 15:25:44 +0200 |
---|---|---|
committer | Thomas Müller <DeepDiver1975@users.noreply.github.com> | 2016-06-21 15:25:44 +0200 |
commit | 1452b74de7f5a3b3afae546b757d2a3889857a61 (patch) | |
tree | 0eba5164f1af53876cdeac866e273ab7a40393a4 /apps/dav/lib/CardDAV/ContactsManager.php | |
parent | f2f1eab7f4ade9abb77f70c6a5c3244b5c6153f4 (diff) | |
download | nextcloud-server-1452b74de7f5a3b3afae546b757d2a3889857a61.tar.gz nextcloud-server-1452b74de7f5a3b3afae546b757d2a3889857a61.zip |
Contacts API: replace raw image data with url (#25081)
* add uri to AddressBookImpl array
* Introduce ImageExportPlugin for CardDav
* add plugin to v1 routes
* replace binary contact photo with link
* update tests
* Adding unit tests
Diffstat (limited to 'apps/dav/lib/CardDAV/ContactsManager.php')
-rw-r--r-- | apps/dav/lib/CardDAV/ContactsManager.php | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/apps/dav/lib/CardDAV/ContactsManager.php b/apps/dav/lib/CardDAV/ContactsManager.php index 7900c6ccae0..ad633483fdd 100644 --- a/apps/dav/lib/CardDAV/ContactsManager.php +++ b/apps/dav/lib/CardDAV/ContactsManager.php @@ -22,6 +22,7 @@ namespace OCA\DAV\CardDAV; use OCP\Contacts\IManager; +use OCP\IURLGenerator; class ContactsManager { @@ -37,26 +38,29 @@ class ContactsManager { /** * @param IManager $cm * @param string $userId + * @param IURLGenerator $urlGenerator */ - public function setupContactsProvider(IManager $cm, $userId) { + public function setupContactsProvider(IManager $cm, $userId, IURLGenerator $urlGenerator) { $addressBooks = $this->backend->getAddressBooksForUser("principals/users/$userId"); - $this->register($cm, $addressBooks); + $this->register($cm, $addressBooks, $urlGenerator); $addressBooks = $this->backend->getAddressBooksForUser("principals/system/system"); - $this->register($cm, $addressBooks); + $this->register($cm, $addressBooks, $urlGenerator); } /** * @param IManager $cm * @param $addressBooks + * @param IURLGenerator $urlGenerator */ - private function register(IManager $cm, $addressBooks) { + private function register(IManager $cm, $addressBooks, $urlGenerator) { foreach ($addressBooks as $addressBookInfo) { $addressBook = new \OCA\DAV\CardDAV\AddressBook($this->backend, $addressBookInfo); $cm->registerAddressBook( new AddressBookImpl( $addressBook, $addressBookInfo, - $this->backend + $this->backend, + $urlGenerator ) ); } |