diff --git a/lib/private/Collaboration/Collaborators/RemotePlugin.php b/lib/private/Collaboration/Collaborators/RemotePlugin.php index 669954e8e6890..437b5724e225c 100644 --- a/lib/private/Collaboration/Collaborators/RemotePlugin.php +++ b/lib/private/Collaboration/Collaborators/RemotePlugin.php @@ -85,8 +85,18 @@ public function search($search, $limit, $offset, ISearchResult $searchResult) { // TODO: inject $localUser = \OC::$server->getUserManager()->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) {