Open
Description
Every time I need to get all the members of a circle I need to set the current User as the circle owner, and then get all members.
$origUser = $this->userSession->getUser();
foreach ($circles as $circleId) {
try {
$circle = \OCA\Circles\Api\v1\Circles::detailsCircle($circleId);
$this->userSession->setUser($this->userManager->get($circle->getOwner()->getUserId()));
$circle = \OCA\Circles\Api\v1\Circles::detailsCircle($circleId);
$members = $circle->getMembers();
foreach ($members as $member) {
$users[] = $member->getUserId();
}
} catch (QueryException $e) {
}
}
$this->userSession->setUser($origUser);
I needed to do this several times, in an implementation of calendar reminders to circle members and also in circle -> matrix integration. Is there a way in the api to query for all circle members, independently of the current logged-in user? If not yet, can one be created?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment