From ba1957daec3bfc396245f8817902b4392e051522 Mon Sep 17 00:00:00 2001 From: tetebueno <9064236+tetebueno@users.noreply.github.com> Date: Thu, 7 Dec 2023 16:24:27 -0300 Subject: [PATCH] Adding prefix, suffix and middle name to contacts. These fields are not being migrated. According to the following sources, this can be achieved: https://www.evenx.com/vcard-3-0-format-specification https://developers.google.com/people/api/rest/v1/people?hl=en#Person.Name Signed-off-by: tetebueno <9064236+tetebueno@users.noreply.github.com> --- lib/Service/GoogleContactsAPIService.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/Service/GoogleContactsAPIService.php b/lib/Service/GoogleContactsAPIService.php index c833721b..ead89b36 100644 --- a/lib/Service/GoogleContactsAPIService.php +++ b/lib/Service/GoogleContactsAPIService.php @@ -214,8 +214,11 @@ public function importContacts(string $userId, ?string $uri, int $key, ?string $ $displayName = $n['displayName'] ?? ''; $familyName = $n['familyName'] ?? ''; $firstName = $n['givenName'] ?? ''; - if ($familyName || $firstName) { - $prop = $vCard->createProperty('N', [0 => $familyName, 1 => $firstName, 2 => '', 3 => '', 4 => '']); + $additionalName = $n['middleName'] ?? ''; + $prefix = $n['honorificPrefix'] ?? ''; + $suffix = $n['honorificSuffix'] ?? ''; + if ($familyName || $firstName || $additionalName || $prefix || $suffix) { + $prop = $vCard->createProperty('N', [0 => $familyName, 1 => $firstName, 2 => $additionalName, 3 => $prefix, 4 => $suffix]); $vCard->add($prop); } break;