Skip to content

Commit

Permalink
forceAll in linkedGroups
Browse files Browse the repository at this point in the history
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
  • Loading branch information
ArtificialOwl authored and backportbot[bot] committed May 5, 2021
1 parent bc2442f commit 78240f4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions lib/Db/MembersRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -512,8 +512,8 @@ public function createMember(Member $member) {
*
* @return Member[]
*/
public function getGroupsFromCircle($circleUniqueId, Member $viewer) {
if ($viewer->getLevel() < Member::LEVEL_MEMBER) {
public function getGroupsFromCircle($circleUniqueId, ?Member $viewer, bool $forceAll = false) {
if (!$forceAll && $viewer->getLevel() < Member::LEVEL_MEMBER) {
return [];
}

Expand All @@ -527,7 +527,7 @@ public function getGroupsFromCircle($circleUniqueId, Member $viewer) {
$cursor = $qb->execute();
$groups = [];
while ($data = $cursor->fetch()) {
if ($viewer->getLevel() < Member::LEVEL_MODERATOR) {
if (!$forceAll && $viewer->getLevel() < Member::LEVEL_MODERATOR) {
$data['note'] = '';
}
$groups[] = $this->parseGroupsSelectSql($data);
Expand Down
6 changes: 3 additions & 3 deletions lib/Service/CirclesService.php
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ public function detailsCircle($circleUniqueId, $forceAll = false) {
->isLevel(Member::LEVEL_MEMBER)
) {
$this->detailsCircleMembers($circle, $forceAll);
$this->detailsCircleLinkedGroups($circle);
$this->detailsCircleLinkedGroups($circle, $forceAll);
$this->detailsCircleFederatedCircles($circle);
}
} catch (Exception $e) {
Expand Down Expand Up @@ -324,12 +324,12 @@ private function detailsCircleMembers(Circle $circle, $forceAll = false) {
*
* @throws GSStatusException
*/
private function detailsCircleLinkedGroups(Circle $circle) {
private function detailsCircleLinkedGroups(Circle $circle, bool $forceAll = false) {
$groups = [];
if ($this->configService->isLinkedGroupsAllowed()) {
$groups =
$this->membersRequest->getGroupsFromCircle(
$circle->getUniqueId(), $circle->getHigherViewer()
$circle->getUniqueId(), $circle->getHigherViewer(), $forceAll
);
}

Expand Down

0 comments on commit 78240f4

Please sign in to comment.