Merge pull request #27761 from nextcloud/bugfix/noid/also-hide-group-from-direct-match

Also hide group from direct matches
This commit is contained in:
Julius Härtl 2021-07-14 13:07:00 +02:00 committed by GitHub
commit 59f0fc0e2b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -128,7 +128,7 @@ class GroupPlugin implements ISearchPlugin {
// On page one we try if the search result has a direct hit on the
// user id and if so, we add that to the exact match list
$group = $this->groupManager->get($search);
if ($group instanceof IGroup && (!$this->shareWithGroupOnly || in_array($group->getGID(), $userGroups))) {
if ($group instanceof IGroup && !$group->hideFromCollaboration() && (!$this->shareWithGroupOnly || in_array($group->getGID(), $userGroups))) {
$result['exact'][] = [
'label' => $group->getDisplayName(),
'value' => [