From b6c58222c74d14dc7893f44d336698cdac50bd2a Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Fri, 10 Jan 2025 08:57:23 +0100 Subject: [PATCH 1/2] feat(meeting): Allow to give a list of attendee ids to invite Signed-off-by: Joas Schilling --- lib/Controller/RoomController.php | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/lib/Controller/RoomController.php b/lib/Controller/RoomController.php index 8285fcedac8..0cc910da5f4 100644 --- a/lib/Controller/RoomController.php +++ b/lib/Controller/RoomController.php @@ -2578,6 +2578,7 @@ public function getCapabilities(): DataResponse { * * @param string $calendarUri Last part of the calendar URI as seen by the participant e.g. 'personal' or 'company_shared_by_other_user' * @param int $start Unix timestamp when the meeting starts + * @param ?list $attendeeIds List of attendee ids to invite, if null everyone will be invited, if empty array only the actor will receive the event * @param ?int $end Unix timestamp when the meeting ends, falls back to 60 minutes after start * @param ?string $title Title or summary of the event, falling back to the conversation name if none is given * @param ?string $description Description of the event, falling back to the conversation description if none is given @@ -2588,7 +2589,7 @@ public function getCapabilities(): DataResponse { */ #[NoAdminRequired] #[RequireLoggedInModeratorParticipant] - public function scheduleMeeting(string $calendarUri, int $start, ?int $end = null, ?string $title = null, ?string $description = null): DataResponse { + public function scheduleMeeting(string $calendarUri, int $start, ?array $attendeeIds = null, ?int $end = null, ?string $title = null, ?string $description = null): DataResponse { $eventBuilder = $this->calendarManager->createEventBuilder(); $calendars = $this->calendarManager->getCalendarsForPrincipal('principals/users/' . $this->userId, [$calendarUri]); @@ -2631,9 +2632,13 @@ public function scheduleMeeting(string $calendarUri, int $start, ?int $end = nul $eventBuilder->setStartDate($startDate); $eventBuilder->setEndDate($endDate); - $userIds = $this->participantService->getParticipantUserIds($this->room); - foreach ($userIds as $userId) { - $targetUser = $this->userManager->get($userId); + $userAttendees = $this->participantService->getParticipantsByActorType($this->room, Attendee::ACTOR_USERS); + foreach ($userAttendees as $userAttendee) { + if ($attendeeIds !== null && !in_array($userAttendee->getAttendee()->getId(), $attendeeIds, true)) { + continue; + } + + $targetUser = $this->userManager->get($userAttendee->getAttendee()->getActorId()); if (!$targetUser instanceof IUser) { continue; } @@ -2649,6 +2654,10 @@ public function scheduleMeeting(string $calendarUri, int $start, ?int $end = nul $emailGuests = $this->participantService->getParticipantsByActorType($this->room, Attendee::ACTOR_EMAILS); foreach ($emailGuests as $emailGuest) { + if ($attendeeIds !== null && !in_array($emailGuest->getAttendee()->getId(), $attendeeIds, true)) { + continue; + } + $eventBuilder->addAttendee( $emailGuest->getAttendee()->getInvitedCloudId(), $emailGuest->getAttendee()->getDisplayName(), From 1b77ec6d8cc52e60a350e1e34c55eb32a204f941 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Fri, 10 Jan 2025 08:59:06 +0100 Subject: [PATCH 2/2] chore(assets): Recompile assets Signed-off-by: Joas Schilling --- openapi-full.json | 9 +++++++++ openapi.json | 9 +++++++++ src/types/openapi/openapi-full.ts | 2 ++ src/types/openapi/openapi.ts | 2 ++ 4 files changed, 22 insertions(+) diff --git a/openapi-full.json b/openapi-full.json index c4036183369..6dff86acbb6 100644 --- a/openapi-full.json +++ b/openapi-full.json @@ -17561,6 +17561,15 @@ "format": "int64", "description": "Unix timestamp when the meeting starts" }, + "attendeeIds": { + "type": "array", + "nullable": true, + "description": "List of attendee ids to invite, if null everyone will be invited, if empty array only the actor will receive the event", + "items": { + "type": "integer", + "format": "int64" + } + }, "end": { "type": "integer", "format": "int64", diff --git a/openapi.json b/openapi.json index a188eb108e7..df2397ebf40 100644 --- a/openapi.json +++ b/openapi.json @@ -17719,6 +17719,15 @@ "format": "int64", "description": "Unix timestamp when the meeting starts" }, + "attendeeIds": { + "type": "array", + "nullable": true, + "description": "List of attendee ids to invite, if null everyone will be invited, if empty array only the actor will receive the event", + "items": { + "type": "integer", + "format": "int64" + } + }, "end": { "type": "integer", "format": "int64", diff --git a/src/types/openapi/openapi-full.ts b/src/types/openapi/openapi-full.ts index ad38e0edf1a..9dd7dd543cb 100644 --- a/src/types/openapi/openapi-full.ts +++ b/src/types/openapi/openapi-full.ts @@ -8704,6 +8704,8 @@ export interface operations { * @description Unix timestamp when the meeting starts */ start: number; + /** @description List of attendee ids to invite, if null everyone will be invited, if empty array only the actor will receive the event */ + attendeeIds?: number[] | null; /** * Format: int64 * @description Unix timestamp when the meeting ends, falls back to 60 minutes after start diff --git a/src/types/openapi/openapi.ts b/src/types/openapi/openapi.ts index e9c79f43f4e..f3eb66da936 100644 --- a/src/types/openapi/openapi.ts +++ b/src/types/openapi/openapi.ts @@ -8288,6 +8288,8 @@ export interface operations { * @description Unix timestamp when the meeting starts */ start: number; + /** @description List of attendee ids to invite, if null everyone will be invited, if empty array only the actor will receive the event */ + attendeeIds?: number[] | null; /** * Format: int64 * @description Unix timestamp when the meeting ends, falls back to 60 minutes after start