aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorJulius Härtl <jus@bitgrid.net>2020-12-14 16:54:47 +0100
committerGitHub <noreply@github.com>2020-12-14 16:54:47 +0100
commitb56d7f9f4e0b9c5126c7a87544e918713923e96e (patch)
treed5339541c338cd1008c1467bc1e5be9e05dc5a54 /lib
parent39bee7948d44c2f5d6f5465bc9c4c3ffe6b8c34e (diff)
parent8b13fd4a6cf1e69bb54fdabe800a41d328a2d46f (diff)
downloadnextcloud-server-b56d7f9f4e0b9c5126c7a87544e918713923e96e.tar.gz
nextcloud-server-b56d7f9f4e0b9c5126c7a87544e918713923e96e.zip
Merge pull request #23017 from nextcloud/enh/distinguish-users
Diffstat (limited to 'lib')
-rw-r--r--lib/private/Collaboration/Collaborators/MailPlugin.php3
-rw-r--r--lib/private/Collaboration/Collaborators/RemotePlugin.php3
-rw-r--r--lib/private/Collaboration/Collaborators/UserPlugin.php5
3 files changed, 10 insertions, 1 deletions
diff --git a/lib/private/Collaboration/Collaborators/MailPlugin.php b/lib/private/Collaboration/Collaborators/MailPlugin.php
index 90dc5919176..7bdd29afc4e 100644
--- a/lib/private/Collaboration/Collaborators/MailPlugin.php
+++ b/lib/private/Collaboration/Collaborators/MailPlugin.php
@@ -136,6 +136,8 @@ class MailPlugin implements ISearchPlugin {
'shareType' => IShare::TYPE_USER,
'shareWith' => $cloud->getUser(),
],
+ 'shareWithDisplayNameUnique' => !empty($emailAddress) ? $emailAddress : $cloud->getUser()
+
]];
$searchResult->addResultSet($userType, [], $singleResult);
$searchResult->markExactIdMatch($emailType);
@@ -170,6 +172,7 @@ class MailPlugin implements ISearchPlugin {
'shareType' => IShare::TYPE_USER,
'shareWith' => $cloud->getUser(),
],
+ 'shareWithDisplayNameUnique' => !empty($emailAddress) ? $emailAddress : $cloud->getUser()
];
continue;
}
diff --git a/lib/private/Collaboration/Collaborators/RemotePlugin.php b/lib/private/Collaboration/Collaborators/RemotePlugin.php
index af94027fbe9..3d9b1f9847a 100644
--- a/lib/private/Collaboration/Collaborators/RemotePlugin.php
+++ b/lib/private/Collaboration/Collaborators/RemotePlugin.php
@@ -103,7 +103,8 @@ class RemotePlugin implements ISearchPlugin {
'value' => [
'shareType' => IShare::TYPE_USER,
'shareWith' => $remoteUser
- ]
+ ],
+ 'shareWithDisplayNameUnique' => $contact['EMAIL'] !== null && $contact['EMAIL'] !== '' ? $contact['EMAIL'] : $contact['UID'],
];
}
diff --git a/lib/private/Collaboration/Collaborators/UserPlugin.php b/lib/private/Collaboration/Collaborators/UserPlugin.php
index cd4963197ae..0b51a29ae25 100644
--- a/lib/private/Collaboration/Collaborators/UserPlugin.php
+++ b/lib/private/Collaboration/Collaborators/UserPlugin.php
@@ -162,6 +162,7 @@ class UserPlugin implements ISearchPlugin {
'shareType' => IShare::TYPE_USER,
'shareWith' => $uid,
],
+ 'shareWithDisplayNameUnique' => !empty($userEmail) ? $userEmail : $uid,
'status' => $status,
];
} else {
@@ -186,6 +187,7 @@ class UserPlugin implements ISearchPlugin {
'shareType' => IShare::TYPE_USER,
'shareWith' => $uid,
],
+ 'shareWithDisplayNameUnique' => !empty($userEmail) ? $userEmail : $uid,
'status' => $status,
];
}
@@ -207,6 +209,8 @@ class UserPlugin implements ISearchPlugin {
if ($addUser) {
$status = [];
+ $uid = $user->getUID();
+ $userEmail = $user->getEMailAddress();
if (array_key_exists($user->getUID(), $userStatuses)) {
$userStatus = $userStatuses[$user->getUID()];
$status = [
@@ -227,6 +231,7 @@ class UserPlugin implements ISearchPlugin {
'shareType' => IShare::TYPE_USER,
'shareWith' => $user->getUID(),
],
+ 'shareWithDisplayNameUnique' => $userEmail !== null && $userEmail !== '' ? $userEmail : $uid,
'status' => $status,
];
}