Add local share if remote cloud id matches a local user ones

Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
Julius Härtl 2018-10-23 09:24:04 +02:00
parent 61af607525
commit 7a65779316
No known key found for this signature in database
GPG key ID: 4C614C6ED2CDE6DF

View file

@ -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) {