mirror of
https://github.com/nextcloud/server.git
synced 2026-05-28 04:32:30 -04:00
Add fallback options for contacts array
when the UID or FN is null, the email address / dsiplay name will be used instead Signed-off-by: Anna Larch <anna@nextcloud.com>
This commit is contained in:
parent
115058720a
commit
b1617bca39
1 changed files with 8 additions and 8 deletions
|
|
@ -165,8 +165,8 @@ class MailPlugin implements ISearchPlugin {
|
|||
if (!$this->isCurrentUser($cloud) && !$searchResult->hasResult($userType, $cloud->getUser())) {
|
||||
$singleResult = [[
|
||||
'label' => $displayName,
|
||||
'uuid' => $contact['UID'],
|
||||
'name' => $contact['FN'],
|
||||
'uuid' => $contact['UID'] ?? $emailAddress,
|
||||
'name' => $contact['FN'] ?? $displayName,
|
||||
'value' => [
|
||||
'shareType' => IShare::TYPE_USER,
|
||||
'shareWith' => $cloud->getUser(),
|
||||
|
|
@ -205,8 +205,8 @@ class MailPlugin implements ISearchPlugin {
|
|||
if ($addToWide && !$this->isCurrentUser($cloud) && !$searchResult->hasResult($userType, $cloud->getUser())) {
|
||||
$userResults['wide'][] = [
|
||||
'label' => $displayName,
|
||||
'uuid' => $contact['UID'],
|
||||
'name' => $contact['FN'],
|
||||
'uuid' => $contact['UID'] ?? $emailAddress,
|
||||
'name' => $contact['FN'] ?? $displayName,
|
||||
'value' => [
|
||||
'shareType' => IShare::TYPE_USER,
|
||||
'shareWith' => $cloud->getUser(),
|
||||
|
|
@ -226,8 +226,8 @@ class MailPlugin implements ISearchPlugin {
|
|||
}
|
||||
$result['exact'][] = [
|
||||
'label' => $displayName,
|
||||
'uuid' => $contact['UID'],
|
||||
'name' => $contact['FN'],
|
||||
'uuid' => $contact['UID'] ?? $emailAddress,
|
||||
'name' => $contact['FN'] ?? $displayName,
|
||||
'type' => $emailAddressType ?? '',
|
||||
'value' => [
|
||||
'shareType' => IShare::TYPE_EMAIL,
|
||||
|
|
@ -237,8 +237,8 @@ class MailPlugin implements ISearchPlugin {
|
|||
} else {
|
||||
$result['wide'][] = [
|
||||
'label' => $displayName,
|
||||
'uuid' => $contact['UID'],
|
||||
'name' => $contact['FN'],
|
||||
'uuid' => $contact['UID'] ?? $emailAddress,
|
||||
'name' => $contact['FN'] ?? $displayName,
|
||||
'type' => $emailAddressType ?? '',
|
||||
'value' => [
|
||||
'shareType' => IShare::TYPE_EMAIL,
|
||||
|
|
|
|||
Loading…
Reference in a new issue