Fix namespace and FN default

This commit is contained in:
Akhil 2023-09-08 14:04:37 +05:30
parent 46cfa9ffa1
commit cc25129a5e
No known key found for this signature in database
GPG key ID: A8AB680DBB7F3D45

View file

@ -1,10 +1,9 @@
<?php
use RainLoop\Providers\AddressBook\Classes\Contact;
use Sabre\VObject\Component\VCard;
class NextcloudAddressBook implements \RainLoop\Providers\AddressBook\AddressBookInterface
{
use Rainloop\Providers\AddressBook\CardDAV;
use RainLoop\Providers\AddressBook\CardDAV;
private const URI = 'webmail';
private $contactsManager;
private $key;
@ -126,6 +125,8 @@ class NextcloudAddressBook implements \RainLoop\Providers\AddressBook\AddressBoo
$properties['EMAIL'] = \trim($sEmail);
if ('' !== \trim($oEmail->GetDisplayName())) {
$properties['FN'] = $oEmail->GetDisplayName();
} else {
$properties['FN'] = \trim($sEmail);
}
$this->contactsManager->createOrUpdate($properties, $this->key);
}