diff --git a/lib/Service/ParticipantService.php b/lib/Service/ParticipantService.php index d3270018965d..fc4c364dad5a 100644 --- a/lib/Service/ParticipantService.php +++ b/lib/Service/ParticipantService.php @@ -1622,6 +1622,13 @@ public function getParticipantUserIds(Room $room, ?\DateTime $maxLastJoined = nu return $this->getParticipantActorIdsByActorType($room, Attendee::ACTOR_USERS, $maxLastJoined); } + /** + * @return string[] + */ + public function getFederatedParticipantCloudIds(Room $room, ?\DateTime $maxLastJoined = null): array { + return $this->getParticipantActorIdsByActorType($room, Attendee::ACTOR_FEDERATED_USERS, $maxLastJoined); + } + /** * @return string[] */ diff --git a/lib/Signaling/BackendNotifier.php b/lib/Signaling/BackendNotifier.php index 38719bf76e50..ac36086340b2 100644 --- a/lib/Signaling/BackendNotifier.php +++ b/lib/Signaling/BackendNotifier.php @@ -142,6 +142,8 @@ private function backendRequest(Room $room, array $data): ?IResponse { * @throws \Exception */ public function roomInvited(Room $room, array $attendees): void { + $allUserIds = $this->participantService->getParticipantUserIds($room); + $allUserIds = array_merge($allUserIds, $this->participantService->getFederatedParticipantCloudIds($room)); $userIds = []; foreach ($attendees as $attendee) { if ($attendee->getActorType() === Attendee::ACTOR_USERS) { @@ -155,7 +157,7 @@ public function roomInvited(Room $room, array $attendees): void { 'userids' => $userIds, // TODO(fancycode): We should try to get rid of 'alluserids' and // find a better way to notify existing users to update the room. - 'alluserids' => $this->participantService->getParticipantUserIds($room), + 'alluserids' => $allUserIds, 'properties' => $room->getPropertiesForSignaling('', false), ], ]); @@ -177,6 +179,7 @@ public function roomInvited(Room $room, array $attendees): void { */ public function roomsDisinvited(Room $room, array $attendees): void { $allUserIds = $this->participantService->getParticipantUserIds($room); + $allUserIds = array_merge($allUserIds, $this->participantService->getFederatedParticipantCloudIds($room)); sort($allUserIds); $userIds = []; foreach ($attendees as $attendee) { @@ -213,6 +216,7 @@ public function roomsDisinvited(Room $room, array $attendees): void { */ public function roomSessionsRemoved(Room $room, array $sessionIds): void { $allUserIds = $this->participantService->getParticipantUserIds($room); + $allUserIds = array_merge($allUserIds, $this->participantService->getFederatedParticipantCloudIds($room)); sort($allUserIds); $start = microtime(true); $this->backendRequest($room, [ @@ -245,6 +249,9 @@ public function roomModified(Room $room): void { $this->backendRequest($room, [ 'type' => 'update', 'update' => [ + // Message not sent for federated users, as they will receive + // the message from their federated Nextcloud server once the + // property change is propagated. 'userids' => $this->participantService->getParticipantUserIds($room), 'properties' => $room->getPropertiesForSignaling(''), ],