create internal function to get all members of circle, independent of current logged-in user
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?
This feature would be very useful. I sent a pull request for an auditing feature and I already have other demands to improve it, allowing notification (via app activity) of file sharing for all members of a closed circle. But to create this new feature, I need to recover all members of circle. Today, I get notify only admin.
@viniciuscb I think this is fixed, right ?