From 7a65779316b275dedf689f14ce5228b64ec6cb5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Julius=20H=C3=A4rtl?= Date: Tue, 23 Oct 2018 09:24:04 +0200 Subject: [PATCH] Add local share if remote cloud id matches a local user ones MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Julius Härtl --- .../Collaboration/Collaborators/RemotePlugin.php | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/lib/private/Collaboration/Collaborators/RemotePlugin.php b/lib/private/Collaboration/Collaborators/RemotePlugin.php index 3da6bdeb637..abe99125512 100644 --- a/lib/private/Collaboration/Collaborators/RemotePlugin.php +++ b/lib/private/Collaboration/Collaborators/RemotePlugin.php @@ -88,8 +88,18 @@ class RemotePlugin implements ISearchPlugin { } $localUser = $this->userManager->get($remoteUser); - if ($localUser !== null && $cloudId === $localUser->getCloudId()) { - continue; + /** + * Add local share if remote cloud id matches a local user ones + */ + if ($localUser !== null && $remoteUser !== $this->userId && $cloudId === $localUser->getCloudId() ) { + $result['wide'][] = [ + 'label' => $contact['FN'], + 'uuid' => $contact['UID'], + 'value' => [ + 'shareType' => Share::SHARE_TYPE_USER, + 'shareWith' => $remoteUser + ] + ]; } if (strtolower($contact['FN']) === $lowerSearch || strtolower($cloudId) === $lowerSearch) {