Skip to content

Commit

Permalink
add visibility filter to find people method
Browse files Browse the repository at this point in the history
  • Loading branch information
e-five256 committed May 11, 2024
1 parent efb5a2f commit 47b3e53
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/Repository/UserRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -529,6 +529,7 @@ public function findPeople(Magazine $magazine, ?bool $federated = false, $limit
$qb = $this->createQueryBuilder('u', 'u.id');
$qb->andWhere($qb->expr()->in('u.id', $user))
->andWhere('u.isBanned = false')
->andWhere('u.visibility = :visibility')
->andWhere('u.apDeletedAt IS NULL')
->andWhere('u.apTimeoutAt IS NULL')
->andWhere('u.about IS NOT NULL')
Expand All @@ -543,7 +544,8 @@ public function findPeople(Magazine $magazine, ?bool $federated = false, $limit
}
}

$qb->setMaxResults($limit);
$qb->setParameter('visibility', VisibilityInterface::VISIBILITY_VISIBLE)
->setMaxResults($limit);

try {
$users = $qb->getQuery()->getResult(); // @todo
Expand Down

0 comments on commit 47b3e53

Please sign in to comment.