Skip to content

Commit 12f6918

Browse files
committed
fix: Instantiation of ContactsManager
Signed-off-by: Louis Chemineau <[email protected]>
1 parent fbce2f3 commit 12f6918

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

lib/Service/SocialApiService.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ public function __construct(
3838
private CardDavBackend $davBackend,
3939
private ITimeFactory $timeFactory,
4040
private ImageResizer $imageResizer,
41+
private PropertyMapper $propertyMapper,
4142
) {
4243
$this->appName = Application::APP_ID;
4344
}
@@ -115,7 +116,7 @@ protected function getAddressBook(string $addressbookId, ?IManager $manager = nu
115116
* @param {IManager} the contact manager to load
116117
*/
117118
protected function registerAddressbooks($userId, IManager $manager) {
118-
$coma = new ContactsManager($this->davBackend, $this->l10n);
119+
$coma = new ContactsManager($this->davBackend, $this->l10n, $this->propertyMapper);
119120
$coma->setupContactsProvider($manager, $userId, $this->urlGen);
120121
$this->manager = $manager;
121122
}
@@ -227,7 +228,7 @@ public function updateContact(string $addressbookId, string $contactId, ?string
227228
*/
228229
public function existsAddressBook(string $searchBookId, string $userId): bool {
229230
$manager = $this->manager;
230-
$coma = new ContactsManager($this->davBackend, $this->l10n);
231+
$coma = new ContactsManager($this->davBackend, $this->l10n, $this->propertyMapper);
231232
$coma->setupContactsProvider($manager, $userId, $this->urlGen);
232233
$addressBooks = $manager->getUserAddressBooks();
233234
return $this->getAddressBook($searchBookId, $manager) !== null;
@@ -245,7 +246,7 @@ public function existsAddressBook(string $searchBookId, string $userId): bool {
245246
public function existsContact(string $searchContactId, string $searchBookId, string $userId): bool {
246247
// load address books for the user
247248
$manager = $this->manager;
248-
$coma = new ContactsManager($this->davBackend, $this->l10n);
249+
$coma = new ContactsManager($this->davBackend, $this->l10n, $this->propertyMapper);
249250
$coma->setupContactsProvider($manager, $userId, $this->urlGen);
250251
$addressBook = $this->getAddressBook($searchBookId, $manager);
251252
if ($addressBook == null) {

0 commit comments

Comments
 (0)