Skip to content

Commit

Permalink
import contact notes
Browse files Browse the repository at this point in the history
Signed-off-by: Julien Veyssier <[email protected]>
  • Loading branch information
julien-nc committed Dec 22, 2022
1 parent 5ec97e9 commit a6e8b6e
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions lib/Service/GoogleContactsAPIService.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ public function getContactList(string $userId): Generator {
$params = [
'personFields' => implode(',', [
'addresses',
'biographies',
'birthdays',
'emailAddresses',
'genders',
Expand Down Expand Up @@ -220,6 +221,16 @@ public function importContacts(string $userId, ?string $uri, int $key, ?string $
continue;
}

// notes
if (isset($c['biographies']) && is_array($c['biographies'])) {
foreach ($c['biographies'] as $biography) {
if (isset($biography['value'], $biography['contentType']) && $biography['contentType'] === 'TEXT_PLAIN') {
$prop = $vCard->createProperty('NOTE', $biography['value']);
$vCard->add($prop);
}
}
}

// group/label
if (isset($c['memberships']) && is_array($c['memberships'])) {
$contactGroupNames = [];
Expand Down

0 comments on commit a6e8b6e

Please sign in to comment.