diff options
author | Vincent Petry <vincent@nextcloud.com> | 2021-01-29 17:54:57 +0300 |
---|---|---|
committer | Vincent Petry <vincent@nextcloud.com> | 2021-01-29 17:54:57 +0300 |
commit | 76543aadc7249a8e6b52a160c939d4ddf6220cc5 (patch) | |
tree | f60ac73dcd7ad7109dcd3c4ac6bf7731ea1da42a /lib/Controller | |
parent | 1b460b842f858e7bbfe18ea3fa112bb8ad4cd939 (diff) |
Allow specifying participant on email resend API
Signed-off-by: Vincent Petry <vincent@nextcloud.com>
Diffstat (limited to 'lib/Controller')
-rw-r--r-- | lib/Controller/RoomController.php | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/lib/Controller/RoomController.php b/lib/Controller/RoomController.php index 1bc7b285b..a3cb6fdd2 100644 --- a/lib/Controller/RoomController.php +++ b/lib/Controller/RoomController.php @@ -1816,10 +1816,22 @@ class RoomController extends AEnvironmentAwareController { * @NoAdminRequired * @RequireModeratorParticipant * + * @param ?string $participant participant * @return DataResponse */ - public function resendEmails(): DataResponse { - $participants = $this->participantService->getParticipantsForRoom($this->room); + public function resendEmails(?string $participant): DataResponse { + $participants = []; + // targetting specific participant + if ($participantId !== null) { + try { + $participants[] = $this->room->getParticipant($participantId); + } catch (ParticipantNotFoundException $e) { + return new DataResponse([], Http::STATUS_NOT_FOUND); + } + } else { + $participants = $this->participantService->getParticipantsForRoom($this->room); + } + foreach ($participants as $participant) { if ($participant->getAttendee()->getActorType() === Attendee::ACTOR_EMAILS) { // generate PIN if applicable |