diff --git a/lib/Signaling/BackendNotifier.php b/lib/Signaling/BackendNotifier.php index 181580b426b..e04ebea0741 100644 --- a/lib/Signaling/BackendNotifier.php +++ b/lib/Signaling/BackendNotifier.php @@ -151,14 +151,14 @@ public function roomInvited(Room $room, array $attendees): void { $userIds[] = $attendee->getActorId(); } } + if (empty($userIds)) { + return; + } $start = microtime(true); $this->backendRequest($room, [ 'type' => 'invite', 'invite' => [ '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->getParticipantUserIdsAndFederatedUserCloudIds($room), 'properties' => $this->roomPropertiesHelper->getPropertiesForSignaling($room, '', false), ], ]); @@ -179,22 +179,20 @@ public function roomInvited(Room $room, array $attendees): void { * @throws \Exception */ public function roomsDisinvited(Room $room, array $attendees): void { - $allUserIds = $this->participantService->getParticipantUserIdsAndFederatedUserCloudIds($room); - sort($allUserIds); $userIds = []; foreach ($attendees as $attendee) { if ($attendee->getActorType() === Attendee::ACTOR_USERS) { $userIds[] = $attendee->getActorId(); } } + if (empty($userIds)) { + return; + } $start = microtime(true); $this->backendRequest($room, [ 'type' => 'disinvite', 'disinvite' => [ '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' => $allUserIds, 'properties' => $this->roomPropertiesHelper->getPropertiesForSignaling($room, '', false), ], ]); @@ -215,16 +213,11 @@ public function roomsDisinvited(Room $room, array $attendees): void { * @throws \Exception */ public function roomSessionsRemoved(Room $room, array $sessionIds): void { - $allUserIds = $this->participantService->getParticipantUserIdsAndFederatedUserCloudIds($room); - sort($allUserIds); $start = microtime(true); $this->backendRequest($room, [ 'type' => 'disinvite', 'disinvite' => [ 'sessionids' => $sessionIds, - // TODO(fancycode): We should try to get rid of 'alluserids' and - // find a better way to notify existing users to update the room. - 'alluserids' => $allUserIds, 'properties' => $this->roomPropertiesHelper->getPropertiesForSignaling($room, '', false), ], ]); @@ -248,10 +241,6 @@ 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' => $this->roomPropertiesHelper->getPropertiesForSignaling($room, ''), ], ]); @@ -267,16 +256,13 @@ public function roomModified(Room $room): void { * The given room has been deleted. * * @param Room $room - * @param string[] $userIds * @throws \Exception */ - public function roomDeleted(Room $room, array $userIds): void { + public function roomDeleted(Room $room): void { $start = microtime(true); $this->backendRequest($room, [ 'type' => 'delete', - 'delete' => [ - 'userids' => $userIds, - ], + 'delete' => new \stdClass(), ]); $duration = microtime(true) - $start; $this->logger->debug('Room deleted: {token} ({duration})', [ @@ -322,7 +308,6 @@ public function switchToRoom(Room $room, string $switchToRoomToken, array $sessi */ public function participantsModified(Room $room, array $sessionIds): void { $changed = []; - $users = []; $participants = $this->participantService->getSessionsAndParticipantsForRoom($room); foreach ($participants as $participant) { $attendee = $participant->getAttendee(); @@ -353,7 +338,6 @@ public function participantsModified(Room $room, array $sessionIds): void { $data['lastPing'] = $session->getLastPing(); $data['sessionId'] = $session->getSessionId(); $data['participantPermissions'] = $participant->getPermissions(); - $users[] = $data; if (\in_array($session->getSessionId(), $sessionIds, true)) { $data['permissions'] = []; @@ -371,17 +355,17 @@ public function participantsModified(Room $room, array $sessionIds): void { } $changed[] = $data; } - } else { - $users[] = $data; } } + if (empty($changed)) { + return; + } $start = microtime(true); $this->backendRequest($room, [ 'type' => 'participants', 'participants' => [ 'changed' => $changed, - 'users' => $users ], ]); $duration = microtime(true) - $start; @@ -410,7 +394,6 @@ public function roomInCallChanged(Room $room, int $flags, array $sessionIds, boo ]; } else { $changed = []; - $users = []; $participants = $this->participantService->getParticipantsForAllSessions($room); foreach ($participants as $participant) { @@ -441,19 +424,17 @@ public function roomInCallChanged(Room $room, int $flags, array $sessionIds, boo $data['userId'] = $attendee->getActorId(); } - if ($session->getInCall() !== Participant::FLAG_DISCONNECTED) { - $users[] = $data; - } - if (\in_array($session->getSessionId(), $sessionIds, true)) { $changed[] = $data; } } + if (empty($changed)) { + return; + } $data = [ 'incall' => $flags, 'changed' => $changed, - 'users' => $users, ]; } diff --git a/lib/Signaling/Listener.php b/lib/Signaling/Listener.php index 898522217b3..f007c2e8781 100644 --- a/lib/Signaling/Listener.php +++ b/lib/Signaling/Listener.php @@ -264,7 +264,7 @@ protected function notifyCallEndedForEveryone(CallEndedForEveryoneEvent $event): protected function notifyBeforeRoomDeleted(BeforeRoomDeletedEvent $event): void { $room = $event->getRoom(); - $this->externalSignaling->roomDeleted($room, $this->participantService->getParticipantUserIds($room)); + $this->externalSignaling->roomDeleted($room); } protected function notifyGuestsCleanedUp(GuestsCleanedUpEvent $event): void { @@ -311,9 +311,6 @@ protected function notifyParticipantNameModified(AParticipantModifiedEvent $even protected function notifyParticipantTypeOrPermissionsModified(AParticipantModifiedEvent $event): void { $sessionIds = []; - // If the participant is not active in the room the "participants" - // request will be sent anyway, although with an empty "changed" - // property. $sessions = $this->sessionService->getAllSessionsForAttendee($event->getParticipant()->getAttendee()); foreach ($sessions as $session) { $sessionIds[] = $session->getSessionId(); diff --git a/tests/integration/features/callapi/recording.feature b/tests/integration/features/callapi/recording.feature index 22a790a5095..1add57c0974 100644 --- a/tests/integration/features/callapi/recording.feature +++ b/tests/integration/features/callapi/recording.feature @@ -18,7 +18,7 @@ Feature: callapi/recording Then signaling server received the following requests | token | data | | room1 | {"type":"message","message":{"data":{"type":"recording","recording":{"status":3}}}} | - | room1 | {"type":"update","update":{"userids":["participant1"],"properties":{"name":"Private conversation","type":2,"lobby-state":0,"lobby-timer":null,"read-only":0,"listable":0,"active-since":{"date":"ACTIVE_SINCE()","timezone_type":3,"timezone":"UTC"},"sip-enabled":0,"description":""}}} | + | room1 | {"type":"update","update":{"properties":{"name":"Private conversation","type":2,"lobby-state":0,"lobby-timer":null,"read-only":0,"listable":0,"active-since":{"date":"ACTIVE_SINCE()","timezone_type":3,"timezone":"UTC"},"sip-enabled":0,"description":""}}} | And user "participant1" is participant of the following unordered rooms (v4) | type | name | callRecording | | 2 | room1 | 3 | @@ -47,7 +47,7 @@ Feature: callapi/recording | token | data | | room1 | {"type":"message","message":{"data":{"type":"chat","chat":{"refresh":true,"comment":[]}}}} | | room1 | {"type":"message","message":{"data":{"type":"recording","recording":{"status":0}}}} | - | room1 | {"type":"update","update":{"userids":["participant1"],"properties":{"name":"Private conversation","type":2,"lobby-state":0,"lobby-timer":null,"read-only":0,"listable":0,"active-since":{"date":"ACTIVE_SINCE()","timezone_type":3,"timezone":"UTC"},"sip-enabled":0,"description":""}}} | + | room1 | {"type":"update","update":{"properties":{"name":"Private conversation","type":2,"lobby-state":0,"lobby-timer":null,"read-only":0,"listable":0,"active-since":{"date":"ACTIVE_SINCE()","timezone_type":3,"timezone":"UTC"},"sip-enabled":0,"description":""}}} | Then user "participant1" sees the following system messages in room "room1" with 200 (v1) | room | actorType | actorId | actorDisplayName | systemMessage | | room1 | users | participant1 | participant1-displayname | recording_stopped | diff --git a/tests/integration/features/callapi/update-call-flags.feature b/tests/integration/features/callapi/update-call-flags.feature index 0a5f24337bf..8b4294284a1 100644 --- a/tests/integration/features/callapi/update-call-flags.feature +++ b/tests/integration/features/callapi/update-call-flags.feature @@ -26,12 +26,12 @@ Feature: callapi/update-call-flags Then signaling server received the following requests | token | data | | public room | {"type":"message","message":{"data":{"type":"chat","chat":{"refresh":true,"comment":[]}}}} | - | public room | {"type":"incall","incall":{"incall":7,"changed":[{"inCall":7,"lastPing":LAST_PING(),"sessionId":"SESSION(owner)","nextcloudSessionId":"SESSION(owner)","participantType":1,"participantPermissions":510,"actorType":"users","actorId":"owner","userId":"owner"}],"users":[{"inCall":7,"lastPing":LAST_PING(),"sessionId":"SESSION(owner)","nextcloudSessionId":"SESSION(owner)","participantType":1,"participantPermissions":510,"actorType":"users","actorId":"owner","userId":"owner"}]}} | + | public room | {"type":"incall","incall":{"incall":7,"changed":[{"inCall":7,"lastPing":LAST_PING(),"sessionId":"SESSION(owner)","nextcloudSessionId":"SESSION(owner)","participantType":1,"participantPermissions":510,"actorType":"users","actorId":"owner","userId":"owner"}]}} | And reset signaling server requests When user "owner" updates call flags in room "public room" to "1" with 200 (v4) Then signaling server received the following requests | token | data | - | public room | {"type":"incall","incall":{"incall":1,"changed":[{"inCall":1,"lastPing":LAST_PING(),"sessionId":"SESSION(owner)","nextcloudSessionId":"SESSION(owner)","participantType":1,"participantPermissions":510,"actorType":"users","actorId":"owner","userId":"owner"}],"users":[{"inCall":1,"lastPing":LAST_PING(),"sessionId":"SESSION(owner)","nextcloudSessionId":"SESSION(owner)","participantType":1,"participantPermissions":510,"actorType":"users","actorId":"owner","userId":"owner"}]}} | + | public room | {"type":"incall","incall":{"incall":1,"changed":[{"inCall":1,"lastPing":LAST_PING(),"sessionId":"SESSION(owner)","nextcloudSessionId":"SESSION(owner)","participantType":1,"participantPermissions":510,"actorType":"users","actorId":"owner","userId":"owner"}]}} | And user "moderator" joins call "public room" with 200 (v4) And user "invited user" joins call "public room" with 200 (v4) And user "not invited but joined user" joins call "public room" with 200 (v4) diff --git a/tests/integration/features/chat-1/group-read-only.feature b/tests/integration/features/chat-1/group-read-only.feature index 0278e5869cb..86e63890083 100644 --- a/tests/integration/features/chat-1/group-read-only.feature +++ b/tests/integration/features/chat-1/group-read-only.feature @@ -19,7 +19,7 @@ Feature: chat-1/group-read-only Then signaling server received the following requests | token | data | | group room | {"type":"message","message":{"data":{"type":"chat","chat":{"refresh":true}}}} | - | group room | {"type":"update","update":{"userids":["participant1","participant2"],"properties":{"name":"Private conversation","type":2,"lobby-state":0,"lobby-timer":null,"read-only":1,"listable":0,"active-since":null,"sip-enabled":0,"description":""}}} | + | group room | {"type":"update","update":{"properties":{"name":"Private conversation","type":2,"lobby-state":0,"lobby-timer":null,"read-only":1,"listable":0,"active-since":null,"sip-enabled":0,"description":""}}} | When user "participant1" sends message "Message 2" to room "group room" with 403 Then user "participant1" sees the following messages in room "group room" with 200 | room | actorType | actorId | actorDisplayName | message | messageParameters | @@ -29,7 +29,7 @@ Feature: chat-1/group-read-only Then signaling server received the following requests | token | data | | group room | {"type":"message","message":{"data":{"type":"chat","chat":{"refresh":true}}}} | - | group room | {"type":"update","update":{"userids":["participant1","participant2"],"properties":{"name":"Private conversation","type":2,"lobby-state":0,"lobby-timer":null,"read-only":0,"listable":0,"active-since":null,"sip-enabled":0,"description":""}}} | + | group room | {"type":"update","update":{"properties":{"name":"Private conversation","type":2,"lobby-state":0,"lobby-timer":null,"read-only":0,"listable":0,"active-since":null,"sip-enabled":0,"description":""}}} | When user "participant1" sends message "Message 3" to room "group room" with 201 Then user "participant1" sees the following messages in room "group room" with 200 | room | actorType | actorId | actorDisplayName | message | messageParameters | diff --git a/tests/integration/features/command/user-remove.feature b/tests/integration/features/command/user-remove.feature index e2497eb4231..e71638d53aa 100644 --- a/tests/integration/features/command/user-remove.feature +++ b/tests/integration/features/command/user-remove.feature @@ -85,14 +85,14 @@ Feature: command/user-remove And invoking occ with "talk:user:remove --user participant2" Then signaling server received the following requests | token | data | - | room | {"type":"disinvite","disinvite":{"userids":["participant2"],"alluserids":["participant1"],"properties":{"name":"Private conversation","type":1,"lobby-state":0,"lobby-timer":null,"read-only":0,"listable":0,"active-since":null,"sip-enabled":0,"participant-list":"refresh"}}} | + | room | {"type":"disinvite","disinvite":{"userids":["participant2"],"properties":{"name":"Private conversation","type":1,"lobby-state":0,"lobby-timer":null,"read-only":0,"listable":0,"active-since":null,"sip-enabled":0,"participant-list":"refresh"}}} | # Type changed - | room | {"type":"update","update":{"userids":["participant1"],"properties":{"name":"Private conversation","type":5,"lobby-state":0,"lobby-timer":null,"read-only":0,"listable":0,"active-since":null,"sip-enabled":0,"description":""}}} | + | room | {"type":"update","update":{"properties":{"name":"Private conversation","type":5,"lobby-state":0,"lobby-timer":null,"read-only":0,"listable":0,"active-since":null,"sip-enabled":0,"description":""}}} | # Name changed - | room | {"type":"update","update":{"userids":["participant1"],"properties":{"name":"Private conversation","type":5,"lobby-state":0,"lobby-timer":null,"read-only":0,"listable":0,"active-since":null,"sip-enabled":0,"description":""}}} | + | room | {"type":"update","update":{"properties":{"name":"Private conversation","type":5,"lobby-state":0,"lobby-timer":null,"read-only":0,"listable":0,"active-since":null,"sip-enabled":0,"description":""}}} | | room | {"type":"message","message":{"data":{"type":"chat","chat":{"refresh":true}}}} | # Read only changed - | room | {"type":"update","update":{"userids":["participant1"],"properties":{"name":"Private conversation","type":5,"lobby-state":0,"lobby-timer":null,"read-only":1,"listable":0,"active-since":null,"sip-enabled":0,"description":""}}} | + | room | {"type":"update","update":{"properties":{"name":"Private conversation","type":5,"lobby-state":0,"lobby-timer":null,"read-only":1,"listable":0,"active-since":null,"sip-enabled":0,"description":""}}} | And the command output contains the text "Users successfully removed from all rooms" Then the command was successful And user "participant2" is participant of the following rooms (v4) diff --git a/tests/integration/features/conversation-1/add-participant.feature b/tests/integration/features/conversation-1/add-participant.feature index 338429dbbe2..a31b3fe69b3 100644 --- a/tests/integration/features/conversation-1/add-participant.feature +++ b/tests/integration/features/conversation-1/add-participant.feature @@ -33,7 +33,7 @@ Feature: conversation-1/add-participant And user "participant1" adds user "participant2" to room "room" with 200 (v4) Then signaling server received the following requests | token | data | - | room | {"type":"invite","invite":{"userids":["participant2"],"alluserids":["participant1","participant2"],"properties":{"name":"Private conversation","type":3,"lobby-state":0,"lobby-timer":null,"read-only":0,"listable":0,"active-since":null,"sip-enabled":0,"participant-list":"refresh"}}} | + | room | {"type":"invite","invite":{"userids":["participant2"],"properties":{"name":"Private conversation","type":3,"lobby-state":0,"lobby-timer":null,"read-only":0,"listable":0,"active-since":null,"sip-enabled":0,"participant-list":"refresh"}}} | | room | {"type":"message","message":{"data":{"type":"chat","chat":{"refresh":true}}}} | And user "participant1" is participant of the following rooms (v4) | id | type | participantType | diff --git a/tests/integration/features/conversation-1/breakout-rooms.feature b/tests/integration/features/conversation-1/breakout-rooms.feature index ace2e182b86..c23827e2bda 100644 --- a/tests/integration/features/conversation-1/breakout-rooms.feature +++ b/tests/integration/features/conversation-1/breakout-rooms.feature @@ -70,13 +70,13 @@ Feature: conversation-1/breakout-rooms And user "participant1" starts breakout rooms in room "class room" with 200 (v1) Then signaling server received the following requests | token | data | - | Room 1 | {"type":"update","update":{"userids":["participant1","participant2"],"properties":{"name":"Private conversation","type":2,"lobby-state":0,"lobby-timer":null,"read-only":0,"listable":0,"active-since":null,"sip-enabled":0,"description":""}}} | - | Room 2 | {"type":"update","update":{"userids":["participant1","participant3"],"properties":{"name":"Private conversation","type":2,"lobby-state":0,"lobby-timer":null,"read-only":0,"listable":0,"active-since":null,"sip-enabled":0,"description":""}}} | - | Room 3 | {"type":"update","update":{"userids":["participant1","participant4"],"properties":{"name":"Private conversation","type":2,"lobby-state":0,"lobby-timer":null,"read-only":0,"listable":0,"active-since":null,"sip-enabled":0,"description":""}}} | + | Room 1 | {"type":"update","update":{"properties":{"name":"Private conversation","type":2,"lobby-state":0,"lobby-timer":null,"read-only":0,"listable":0,"active-since":null,"sip-enabled":0,"description":""}}} | + | Room 2 | {"type":"update","update":{"properties":{"name":"Private conversation","type":2,"lobby-state":0,"lobby-timer":null,"read-only":0,"listable":0,"active-since":null,"sip-enabled":0,"description":""}}} | + | Room 3 | {"type":"update","update":{"properties":{"name":"Private conversation","type":2,"lobby-state":0,"lobby-timer":null,"read-only":0,"listable":0,"active-since":null,"sip-enabled":0,"description":""}}} | | class room | {"type":"switchto","switchto":{"roomid":"ROOM(Room 1)","sessions":["SESSION(participant2)"]}} | | class room | {"type":"switchto","switchto":{"roomid":"ROOM(Room 2)","sessions":["SESSION(participant3)"]}} | | class room | {"type":"switchto","switchto":{"roomid":"ROOM(Room 3)","sessions":["SESSION(participant4)"]}} | - | class room | {"type":"update","update":{"userids":["participant1","participant2","participant3","participant4"],"properties":{"name":"Private conversation","type":2,"lobby-state":0,"lobby-timer":null,"read-only":0,"listable":0,"active-since":null,"sip-enabled":0,"description":""}}} | + | class room | {"type":"update","update":{"properties":{"name":"Private conversation","type":2,"lobby-state":0,"lobby-timer":null,"read-only":0,"listable":0,"active-since":null,"sip-enabled":0,"description":""}}} | And user "participant2" leaves room "class room" with 200 (v4) And user "participant3" leaves room "class room" with 200 (v4) And user "participant4" leaves room "class room" with 200 (v4) @@ -90,13 +90,13 @@ Feature: conversation-1/breakout-rooms | Room 1 | {"type":"switchto","switchto":{"roomid":"ROOM(class room)","sessions":["SESSION(participant2)"]}} | | Room 2 | {"type":"switchto","switchto":{"roomid":"ROOM(class room)","sessions":["SESSION(participant3)"]}} | | Room 3 | {"type":"switchto","switchto":{"roomid":"ROOM(class room)","sessions":["SESSION(participant4)"]}} | - | class room | {"type":"update","update":{"userids":["participant1","participant2","participant3","participant4"],"properties":{"name":"Private conversation","type":2,"lobby-state":0,"lobby-timer":null,"read-only":0,"listable":0,"active-since":null,"sip-enabled":0,"description":""}}} | + | class room | {"type":"update","update":{"properties":{"name":"Private conversation","type":2,"lobby-state":0,"lobby-timer":null,"read-only":0,"listable":0,"active-since":null,"sip-enabled":0,"description":""}}} | | Room 1 | {"type":"message","message":{"data":{"type":"chat","chat":{"refresh":true}}}} | - | Room 1 | {"type":"update","update":{"userids":["participant1","participant2"],"properties":{"name":"Private conversation","type":2,"lobby-state":1,"lobby-timer":null,"read-only":0,"listable":0,"active-since":null,"sip-enabled":0,"description":""}}} | + | Room 1 | {"type":"update","update":{"properties":{"name":"Private conversation","type":2,"lobby-state":1,"lobby-timer":null,"read-only":0,"listable":0,"active-since":null,"sip-enabled":0,"description":""}}} | | Room 2 | {"type":"message","message":{"data":{"type":"chat","chat":{"refresh":true}}}} | - | Room 2 | {"type":"update","update":{"userids":["participant1","participant3"],"properties":{"name":"Private conversation","type":2,"lobby-state":1,"lobby-timer":null,"read-only":0,"listable":0,"active-since":null,"sip-enabled":0,"description":""}}} | + | Room 2 | {"type":"update","update":{"properties":{"name":"Private conversation","type":2,"lobby-state":1,"lobby-timer":null,"read-only":0,"listable":0,"active-since":null,"sip-enabled":0,"description":""}}} | | Room 3 | {"type":"message","message":{"data":{"type":"chat","chat":{"refresh":true}}}} | - | Room 3 | {"type":"update","update":{"userids":["participant1","participant4"],"properties":{"name":"Private conversation","type":2,"lobby-state":1,"lobby-timer":null,"read-only":0,"listable":0,"active-since":null,"sip-enabled":0,"description":""}}} | + | Room 3 | {"type":"update","update":{"properties":{"name":"Private conversation","type":2,"lobby-state":1,"lobby-timer":null,"read-only":0,"listable":0,"active-since":null,"sip-enabled":0,"description":""}}} | Scenario: Teacher creates automatic breakout rooms Given user "participant3" exists diff --git a/tests/integration/features/conversation-3/join-leave.feature b/tests/integration/features/conversation-3/join-leave.feature index 6fb8cb0a666..081f8247b68 100644 --- a/tests/integration/features/conversation-3/join-leave.feature +++ b/tests/integration/features/conversation-3/join-leave.feature @@ -94,7 +94,7 @@ Feature: conversation-3/join-leave # Rejoining the same room disinvites the previous session Then signaling server received the following requests | token | data | - | room | {"type":"disinvite","disinvite":{"sessionids":["SESSION(participant1#old)"],"alluserids":["participant1","participant2"],"properties":{"name":"Private conversation","type":3,"lobby-state":0,"lobby-timer":null,"read-only":0,"listable":0,"active-since":null,"sip-enabled":0,"participant-list":"refresh"}}} | + | room | {"type":"disinvite","disinvite":{"sessionids":["SESSION(participant1#old)"],"properties":{"name":"Private conversation","type":3,"lobby-state":0,"lobby-timer":null,"read-only":0,"listable":0,"active-since":null,"sip-enabled":0,"participant-list":"refresh"}}} | And user "participant2" joins room "room" with 200 (v4) And user "participant3" joins room "room" with 200 (v4) And user "guest" joins room "room" with 200 (v4) @@ -108,13 +108,13 @@ Feature: conversation-3/join-leave # Signaling message when a self-joined user leaves Then signaling server received the following requests | token | data | - | room | {"type":"disinvite","disinvite":{"userids":["participant3"],"alluserids":["participant1","participant2"],"properties":{"name":"Private conversation","type":3,"lobby-state":0,"lobby-timer":null,"read-only":0,"listable":0,"active-since":null,"sip-enabled":0,"participant-list":"refresh"}}} | + | room | {"type":"disinvite","disinvite":{"userids":["participant3"],"properties":{"name":"Private conversation","type":3,"lobby-state":0,"lobby-timer":null,"read-only":0,"listable":0,"active-since":null,"sip-enabled":0,"participant-list":"refresh"}}} | And reset signaling server requests And user "guest" leaves room "room" with 200 (v4) # Signaling message when a guest leaves Then signaling server received the following requests | token | data | - | room | {"type":"disinvite","disinvite":{"sessionids":["SESSION(guest)"],"alluserids":["participant1","participant2"],"properties":{"name":"Private conversation","type":3,"lobby-state":0,"lobby-timer":null,"read-only":0,"listable":0,"active-since":null,"sip-enabled":0,"participant-list":"refresh"}}} | + | room | {"type":"disinvite","disinvite":{"sessionids":["SESSION(guest)"],"properties":{"name":"Private conversation","type":3,"lobby-state":0,"lobby-timer":null,"read-only":0,"listable":0,"active-since":null,"sip-enabled":0,"participant-list":"refresh"}}} | Then user "participant1" is participant of room "room" (v4) And user "participant2" is participant of room "room" (v4) And user "participant3" is not participant of room "room" (v4) diff --git a/tests/integration/features/conversation-3/lobby.feature b/tests/integration/features/conversation-3/lobby.feature index 789ffa0d79c..800fb4822dc 100644 --- a/tests/integration/features/conversation-3/lobby.feature +++ b/tests/integration/features/conversation-3/lobby.feature @@ -19,13 +19,13 @@ Feature: conversation-3/lobby Then signaling server received the following requests | token | data | | room | {"type":"message","message":{"data":{"type":"chat","chat":{"refresh":true}}}} | - | room | {"type":"update","update":{"userids":["participant1","participant2","participant3"],"properties":{"name":"Private conversation","type":2,"lobby-state":1,"lobby-timer":null,"read-only":0,"listable":0,"active-since":null,"sip-enabled":0,"description":""}}} | + | room | {"type":"update","update":{"properties":{"name":"Private conversation","type":2,"lobby-state":1,"lobby-timer":null,"read-only":0,"listable":0,"active-since":null,"sip-enabled":0,"description":""}}} | And reset signaling server requests And user "participant1" sets lobby state for room "room" to "no lobby" with 200 (v4) Then signaling server received the following requests | token | data | | room | {"type":"message","message":{"data":{"type":"chat","chat":{"refresh":true}}}} | - | room | {"type":"update","update":{"userids":["participant1","participant2","participant3"],"properties":{"name":"Private conversation","type":2,"lobby-state":0,"lobby-timer":null,"read-only":0,"listable":0,"active-since":null,"sip-enabled":0,"description":""}}} | + | room | {"type":"update","update":{"properties":{"name":"Private conversation","type":2,"lobby-state":0,"lobby-timer":null,"read-only":0,"listable":0,"active-since":null,"sip-enabled":0,"description":""}}} | And user "participant2" sets lobby state for room "room" to "non moderators" with 200 (v4) And user "participant2" sets lobby state for room "room" to "no lobby" with 200 (v4) And user "participant3" sets lobby state for room "room" to "non moderators" with 403 (v4) diff --git a/tests/integration/features/conversation-3/public-private.feature b/tests/integration/features/conversation-3/public-private.feature index cd0aa08f1d9..39de2228c26 100644 --- a/tests/integration/features/conversation-3/public-private.feature +++ b/tests/integration/features/conversation-3/public-private.feature @@ -15,7 +15,7 @@ Feature: conversation-3/public-private Then signaling server received the following requests | token | data | | room | {"type":"message","message":{"data":{"type":"chat","chat":{"refresh":true}}}} | - | room | {"type":"update","update":{"userids":["participant1"],"properties":{"name":"Private conversation","type":2,"lobby-state":0,"lobby-timer":null,"read-only":0,"listable":0,"active-since":null,"sip-enabled":0,"description":""}}} | + | room | {"type":"update","update":{"properties":{"name":"Private conversation","type":2,"lobby-state":0,"lobby-timer":null,"read-only":0,"listable":0,"active-since":null,"sip-enabled":0,"description":""}}} | Then user "participant1" is participant of the following rooms (v4) | id | type | participantType | | room | 2 | 1 | @@ -24,7 +24,7 @@ Feature: conversation-3/public-private Then signaling server received the following requests | token | data | | room | {"type":"message","message":{"data":{"type":"chat","chat":{"refresh":true}}}} | - | room | {"type":"update","update":{"userids":["participant1"],"properties":{"name":"Private conversation","type":3,"lobby-state":0,"lobby-timer":null,"read-only":0,"listable":0,"active-since":null,"sip-enabled":0,"description":""}}} | + | room | {"type":"update","update":{"properties":{"name":"Private conversation","type":3,"lobby-state":0,"lobby-timer":null,"read-only":0,"listable":0,"active-since":null,"sip-enabled":0,"description":""}}} | Then user "participant1" is participant of the following rooms (v4) | id | type | participantType | | room | 3 | 1 | diff --git a/tests/integration/features/conversation-4/promotion-demotion.feature b/tests/integration/features/conversation-4/promotion-demotion.feature index 697422443d7..b7e6eb7f11f 100644 --- a/tests/integration/features/conversation-4/promotion-demotion.feature +++ b/tests/integration/features/conversation-4/promotion-demotion.feature @@ -21,8 +21,7 @@ Feature: conversation-4/promotion-demotion # TODO remove handler with "roomModified" in favour of handler with # "participantsModified" once the clients no longer expect a # "roomModified" message for participant type changes. - | room | {"type":"update","update":{"userids":["participant1","participant2"],"properties":{"name":"Private conversation","type":3,"lobby-state":0,"lobby-timer":null,"read-only":0,"listable":0,"active-since":null,"sip-enabled":0,"description":""}}} | - | room | {"type":"participants","participants":{"changed":[],"users":[{"inCall":0,"lastPing":0,"sessionId":"0","participantType":1,"participantPermissions":1,"displayName":"participant1-displayname","actorType":"users","actorId":"participant1","userId":"participant1"},{"inCall":0,"lastPing":0,"sessionId":"0","participantType":2,"participantPermissions":1,"displayName":"participant2-displayname","actorType":"users","actorId":"participant2","userId":"participant2"}]}} | + | room | {"type":"update","update":{"properties":{"name":"Private conversation","type":3,"lobby-state":0,"lobby-timer":null,"read-only":0,"listable":0,"active-since":null,"sip-enabled":0,"description":""}}} | And user "participant2" is participant of the following rooms (v4) | id | type | participantType | | room | 3 | 2 | diff --git a/tests/integration/features/conversation-4/remove-participant.feature b/tests/integration/features/conversation-4/remove-participant.feature index 9c208c4a130..a12e8f7ee13 100644 --- a/tests/integration/features/conversation-4/remove-participant.feature +++ b/tests/integration/features/conversation-4/remove-participant.feature @@ -103,7 +103,7 @@ Feature: conversation-4/remove-participant Then signaling server received the following requests | token | data | | room | {"type":"message","message":{"data":{"type":"chat","chat":{"refresh":true}}}} | - | room | {"type":"disinvite","disinvite":{"userids":["participant1"],"alluserids":["participant2"],"properties":{"name":"Private conversation","type":3,"lobby-state":0,"lobby-timer":null,"read-only":0,"listable":0,"active-since":null,"sip-enabled":0,"participant-list":"refresh"}}} | + | room | {"type":"disinvite","disinvite":{"userids":["participant1"],"properties":{"name":"Private conversation","type":3,"lobby-state":0,"lobby-timer":null,"read-only":0,"listable":0,"active-since":null,"sip-enabled":0,"participant-list":"refresh"}}} | And user "participant1" is not participant of room "room" (v4) And user "participant2" adds user "participant3" to room "room" with 200 (v4) And user "participant2" promotes "participant3" in room "room" with 200 (v4) diff --git a/tests/integration/features/conversation-4/rename-room.feature b/tests/integration/features/conversation-4/rename-room.feature index 4b597b9e048..982085bc27c 100644 --- a/tests/integration/features/conversation-4/rename-room.feature +++ b/tests/integration/features/conversation-4/rename-room.feature @@ -25,7 +25,7 @@ Feature: conversation-4/rename-room Then signaling server received the following requests | token | data | | room | {"type":"message","message":{"data":{"type":"chat","chat":{"refresh":true}}}} | - | room | {"type":"update","update":{"userids":["participant1","participant2"],"properties":{"name":"Private conversation","type":3,"lobby-state":0,"lobby-timer":null,"read-only":0,"listable":0,"active-since":null,"sip-enabled":0,"description":""}}} | + | room | {"type":"update","update":{"properties":{"name":"Private conversation","type":3,"lobby-state":0,"lobby-timer":null,"read-only":0,"listable":0,"active-since":null,"sip-enabled":0,"description":""}}} | Scenario: User renames Given user "participant2" exists diff --git a/tests/integration/features/conversation-5/delete-room.feature b/tests/integration/features/conversation-5/delete-room.feature index 61746a93d60..40222f7ebf5 100644 --- a/tests/integration/features/conversation-5/delete-room.feature +++ b/tests/integration/features/conversation-5/delete-room.feature @@ -18,7 +18,7 @@ Feature: conversation-5/delete-room When user "participant1" deletes room "room" with 200 (v4) Then signaling server received the following requests | token | data | - | room | {"type":"delete","delete":{"userids":["participant1"]}} | + | room | {"type":"delete","delete":{}} | Then user "participant1" is not participant of room "room" (v4) Scenario: Moderator deletes diff --git a/tests/integration/features/conversation-5/set-description.feature b/tests/integration/features/conversation-5/set-description.feature index 2069c18affa..8acf5ab665a 100644 --- a/tests/integration/features/conversation-5/set-description.feature +++ b/tests/integration/features/conversation-5/set-description.feature @@ -15,7 +15,7 @@ Feature: conversation-5/set-description Then signaling server received the following requests | token | data | | group room | {"type":"message","message":{"data":{"type":"chat","chat":{"refresh":true}}}} | - | group room | {"type":"update","update":{"userids":["owner"],"properties":{"name":"Private conversation","type":2,"lobby-state":0,"lobby-timer":null,"read-only":0,"listable":0,"active-since":null,"sip-enabled":0,"description":"012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678C012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678C012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678C012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678C012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678C012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678C012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678C012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678C012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678C012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678C012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678C012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678C012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678C012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678C012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678C012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678C012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678C012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678C012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678C012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678C"}}} | + | group room | {"type":"update","update":{"properties":{"name":"Private conversation","type":2,"lobby-state":0,"lobby-timer":null,"read-only":0,"listable":0,"active-since":null,"sip-enabled":0,"description":"012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678C012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678C012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678C012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678C012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678C012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678C012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678C012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678C012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678C012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678C012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678C012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678C012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678C012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678C012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678C012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678C012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678C012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678C012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678C012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678C"}}} | Then user "owner" is participant of room "group room" (v4) | description | | 012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678C012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678C012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678C012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678C012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678C012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678C012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678C012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678C012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678C012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678C012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678C012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678C012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678C012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678C012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678C012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678C012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678C012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678C012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678C012345678901234567890123456789012345678901234567890123456789012345678901234567890123456789012345678C | diff --git a/tests/integration/features/conversation-5/set-listable.feature b/tests/integration/features/conversation-5/set-listable.feature index 6b497e56cff..4431132f29a 100644 --- a/tests/integration/features/conversation-5/set-listable.feature +++ b/tests/integration/features/conversation-5/set-listable.feature @@ -39,7 +39,7 @@ Feature: conversation-5/set-listable Then signaling server received the following requests | token | data | | room | {"type":"message","message":{"data":{"type":"chat","chat":{"refresh":true}}}} | - | room | {"type":"update","update":{"userids":["creator","moderator","regular-user"],"properties":{"name":"room","type":3,"lobby-state":0,"lobby-timer":null,"read-only":0,"listable":2,"active-since":null,"sip-enabled":0,"description":""}}} | + | room | {"type":"update","update":{"properties":{"name":"room","type":3,"lobby-state":0,"lobby-timer":null,"read-only":0,"listable":2,"active-since":null,"sip-enabled":0,"description":""}}} | When user "creator" promotes "moderator" in room "room" with 200 (v4) And user "user-guest@example.com" joins room "room" with 200 (v4) And user "guest" joins room "room" with 200 (v4) @@ -48,7 +48,7 @@ Feature: conversation-5/set-listable Then signaling server received the following requests | token | data | | room | {"type":"message","message":{"data":{"type":"chat","chat":{"refresh":true}}}} | - | room | {"type":"update","update":{"userids":["creator","moderator","regular-user","user-guest@example.com"],"properties":{"name":"Private conversation","type":3,"lobby-state":0,"lobby-timer":null,"read-only":0,"listable":0,"active-since":null,"sip-enabled":0,"description":""}}} | + | room | {"type":"update","update":{"properties":{"name":"Private conversation","type":3,"lobby-state":0,"lobby-timer":null,"read-only":0,"listable":0,"active-since":null,"sip-enabled":0,"description":""}}} | And user "regular-user" allows listing room "room" for "users" with 403 (v4) And user "user-guest@example.com" allows listing room "room" for "users" with 403 (v4) And user "guest" allows listing room "room" for "users" with 401 (v4) diff --git a/tests/integration/features/conversation-5/set-password.feature b/tests/integration/features/conversation-5/set-password.feature index 65042280ca3..69e83e910c4 100644 --- a/tests/integration/features/conversation-5/set-password.feature +++ b/tests/integration/features/conversation-5/set-password.feature @@ -16,7 +16,7 @@ Feature: conversation-5/set-password Then signaling server received the following requests | token | data | | room | {"type":"message","message":{"data":{"type":"chat","chat":{"refresh":true}}}} | - | room | {"type":"update","update":{"userids":["participant1"],"properties":{"name":"Private conversation","type":3,"lobby-state":0,"lobby-timer":null,"read-only":0,"listable":0,"active-since":null,"sip-enabled":0,"description":""}}} | + | room | {"type":"update","update":{"properties":{"name":"Private conversation","type":3,"lobby-state":0,"lobby-timer":null,"read-only":0,"listable":0,"active-since":null,"sip-enabled":0,"description":""}}} | Then user "participant3" joins room "room" with 403 (v4) Then user "participant3" joins room "room" with 200 (v4) | password | foobar | diff --git a/tests/php/Signaling/ListenerTest.php b/tests/php/Signaling/ListenerTest.php index 03255ced205..7a19c248979 100644 --- a/tests/php/Signaling/ListenerTest.php +++ b/tests/php/Signaling/ListenerTest.php @@ -223,13 +223,9 @@ public function testRoomDelete(): void { $room ); - $this->participantService->method('getParticipantUserIds') - ->with($room) - ->willReturn(['user1', 'user2']); - $this->backendNotifier->expects($this->once()) ->method('roomDeleted') - ->with($room, ['user1', 'user2']); + ->with($room); $this->listener->handle($event); }