Merge pull request #27964 from nextcloud/backport/27761/stable22

[stable22] Also hide group from direct matches
This commit is contained in:
Joas Schilling 2021-07-14 19:52:19 +02:00 committed by GitHub
commit c04797dca0
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' => [