Filter out generic remote result for local users
Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
parent
ce79e587e4
commit
d7caf841df
|
@ -115,7 +115,14 @@ class RemotePlugin implements ISearchPlugin {
|
||||||
$result['wide'] = array_slice($result['wide'], $offset, $limit);
|
$result['wide'] = array_slice($result['wide'], $offset, $limit);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Add generic share with remote item for valid cloud ids that are not users of the local instance
|
||||||
|
*/
|
||||||
if (!$searchResult->hasExactIdMatch($resultType) && $this->cloudIdManager->isValidCloudId($search) && $offset === 0) {
|
if (!$searchResult->hasExactIdMatch($resultType) && $this->cloudIdManager->isValidCloudId($search) && $offset === 0) {
|
||||||
|
try {
|
||||||
|
list($remoteUser, $serverUrl) = $this->splitUserRemote($search);
|
||||||
|
$localUser = $this->userManager->get($remoteUser);
|
||||||
|
if ($localUser === null || $search !== $localUser->getCloudId()) {
|
||||||
$result['exact'][] = [
|
$result['exact'][] = [
|
||||||
'label' => $search,
|
'label' => $search,
|
||||||
'value' => [
|
'value' => [
|
||||||
|
@ -124,6 +131,9 @@ class RemotePlugin implements ISearchPlugin {
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
} catch (\InvalidArgumentException $e) {
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$searchResult->addResultSet($resultType, $result['wide'], $result['exact']);
|
$searchResult->addResultSet($resultType, $result['wide'], $result['exact']);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue