Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/spreed.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorDaniel Calviño Sánchez <danxuliu@gmail.com>2021-06-04 02:01:42 +0300
committerJoas Schilling <coding@schilljs.com>2021-06-11 10:07:30 +0300
commit4009de75a20434a484e2bdb1c85153e6fc364b45 (patch)
tree9ee5cb1ee1604cf8e687088de4ec28f7c03aafa9 /tests
parentda5d51ecc87031b245dac4789b05e3edc83110bd (diff)
Include "publishingPermissions" in participant messages of signaling
This will allow the clients to react to "publishingPermissions" changes directly from the signaling messages, without needing to fetch again the participants (although they may need to fetch them again nevertheless for UI updates). The internal signaling server also needs to listen to changes on the property to be able to know when to send the message (the external signaling server already listened to the changes to be able to update the permission flags internally). Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/php/Signaling/BackendNotifierTest.php61
1 files changed, 61 insertions, 0 deletions
diff --git a/tests/php/Signaling/BackendNotifierTest.php b/tests/php/Signaling/BackendNotifierTest.php
index 39dabc43d..6c3dd92f7 100644
--- a/tests/php/Signaling/BackendNotifierTest.php
+++ b/tests/php/Signaling/BackendNotifierTest.php
@@ -27,6 +27,7 @@ use OCA\Talk\Chat\CommentsManager;
use OCA\Talk\Config;
use OCA\Talk\Events\SignalingRoomPropertiesEvent;
use OCA\Talk\Manager;
+use OCA\Talk\Model\Attendee;
use OCA\Talk\Model\AttendeeMapper;
use OCA\Talk\Model\SessionMapper;
use OCA\Talk\Participant;
@@ -665,6 +666,7 @@ class BackendNotifierTest extends \Test\TestCase {
'lastPing' => 0,
'sessionId' => $userSession,
'participantType' => Participant::MODERATOR,
+ 'publishingPermissions' => Attendee::PUBLISHING_PERMISSIONS_ALL,
'userId' => $this->userId,
],
],
@@ -674,6 +676,7 @@ class BackendNotifierTest extends \Test\TestCase {
'lastPing' => 0,
'sessionId' => $userSession,
'participantType' => Participant::MODERATOR,
+ 'publishingPermissions' => Attendee::PUBLISHING_PERMISSIONS_ALL,
'userId' => $this->userId,
],
],
@@ -698,6 +701,7 @@ class BackendNotifierTest extends \Test\TestCase {
'lastPing' => 0,
'sessionId' => $guestSession,
'participantType' => Participant::GUEST_MODERATOR,
+ 'publishingPermissions' => Attendee::PUBLISHING_PERMISSIONS_ALL,
],
],
'users' => [
@@ -706,6 +710,7 @@ class BackendNotifierTest extends \Test\TestCase {
'lastPing' => 0,
'sessionId' => $userSession,
'participantType' => Participant::MODERATOR,
+ 'publishingPermissions' => Attendee::PUBLISHING_PERMISSIONS_ALL,
'userId' => $this->userId,
],
[
@@ -713,6 +718,7 @@ class BackendNotifierTest extends \Test\TestCase {
'lastPing' => 0,
'sessionId' => $guestSession,
'participantType' => Participant::GUEST_MODERATOR,
+ 'publishingPermissions' => Attendee::PUBLISHING_PERMISSIONS_ALL,
],
],
],
@@ -739,6 +745,7 @@ class BackendNotifierTest extends \Test\TestCase {
'lastPing' => 0,
'sessionId' => $userSession,
'participantType' => Participant::MODERATOR,
+ 'publishingPermissions' => Attendee::PUBLISHING_PERMISSIONS_ALL,
'userId' => $this->userId,
],
[
@@ -746,6 +753,7 @@ class BackendNotifierTest extends \Test\TestCase {
'lastPing' => 0,
'sessionId' => 0,
'participantType' => Participant::MODERATOR,
+ 'publishingPermissions' => Attendee::PUBLISHING_PERMISSIONS_NONE,
'userId' => $notJoinedUserId,
],
[
@@ -753,6 +761,7 @@ class BackendNotifierTest extends \Test\TestCase {
'lastPing' => 0,
'sessionId' => $guestSession,
'participantType' => Participant::GUEST_MODERATOR,
+ 'publishingPermissions' => Attendee::PUBLISHING_PERMISSIONS_ALL,
],
],
],
@@ -771,6 +780,7 @@ class BackendNotifierTest extends \Test\TestCase {
'lastPing' => 0,
'sessionId' => $userSession,
'participantType' => Participant::USER,
+ 'publishingPermissions' => Attendee::PUBLISHING_PERMISSIONS_ALL,
'userId' => $this->userId,
],
],
@@ -780,6 +790,7 @@ class BackendNotifierTest extends \Test\TestCase {
'lastPing' => 0,
'sessionId' => $userSession,
'participantType' => Participant::USER,
+ 'publishingPermissions' => Attendee::PUBLISHING_PERMISSIONS_ALL,
'userId' => $this->userId,
],
[
@@ -787,6 +798,7 @@ class BackendNotifierTest extends \Test\TestCase {
'lastPing' => 0,
'sessionId' => 0,
'participantType' => Participant::MODERATOR,
+ 'publishingPermissions' => Attendee::PUBLISHING_PERMISSIONS_NONE,
'userId' => $notJoinedUserId,
],
[
@@ -794,6 +806,7 @@ class BackendNotifierTest extends \Test\TestCase {
'lastPing' => 0,
'sessionId' => $guestSession,
'participantType' => Participant::GUEST_MODERATOR,
+ 'publishingPermissions' => Attendee::PUBLISHING_PERMISSIONS_ALL,
],
],
],
@@ -812,6 +825,7 @@ class BackendNotifierTest extends \Test\TestCase {
'lastPing' => 0,
'sessionId' => $guestSession,
'participantType' => Participant::GUEST,
+ 'publishingPermissions' => Attendee::PUBLISHING_PERMISSIONS_ALL,
],
],
'users' => [
@@ -820,6 +834,7 @@ class BackendNotifierTest extends \Test\TestCase {
'lastPing' => 0,
'sessionId' => $userSession,
'participantType' => Participant::USER,
+ 'publishingPermissions' => Attendee::PUBLISHING_PERMISSIONS_ALL,
'userId' => $this->userId,
],
[
@@ -827,6 +842,7 @@ class BackendNotifierTest extends \Test\TestCase {
'lastPing' => 0,
'sessionId' => 0,
'participantType' => Participant::MODERATOR,
+ 'publishingPermissions' => Attendee::PUBLISHING_PERMISSIONS_NONE,
'userId' => $notJoinedUserId,
],
[
@@ -834,6 +850,51 @@ class BackendNotifierTest extends \Test\TestCase {
'lastPing' => 0,
'sessionId' => $guestSession,
'participantType' => Participant::GUEST,
+ 'publishingPermissions' => Attendee::PUBLISHING_PERMISSIONS_ALL,
+ ],
+ ],
+ ],
+ ]);
+
+ $this->controller->clearRequests();
+ $this->participantService->updatePublishingPermissions($room, $guestParticipant, Attendee::PUBLISHING_PERMISSIONS_NONE);
+
+ $this->assertMessageWasSent($room, [
+ 'type' => 'participants',
+ 'participants' => [
+ 'changed' => [
+ [
+ 'permissions' => [],
+ 'inCall' => 0,
+ 'lastPing' => 0,
+ 'sessionId' => $guestSession,
+ 'participantType' => Participant::GUEST,
+ 'publishingPermissions' => Attendee::PUBLISHING_PERMISSIONS_NONE,
+ ],
+ ],
+ 'users' => [
+ [
+ 'inCall' => 0,
+ 'lastPing' => 0,
+ 'sessionId' => $userSession,
+ 'participantType' => Participant::USER,
+ 'publishingPermissions' => Attendee::PUBLISHING_PERMISSIONS_ALL,
+ 'userId' => $this->userId,
+ ],
+ [
+ 'inCall' => 0,
+ 'lastPing' => 0,
+ 'sessionId' => 0,
+ 'participantType' => Participant::MODERATOR,
+ 'publishingPermissions' => Attendee::PUBLISHING_PERMISSIONS_NONE,
+ 'userId' => $notJoinedUserId,
+ ],
+ [
+ 'inCall' => 0,
+ 'lastPing' => 0,
+ 'sessionId' => $guestSession,
+ 'participantType' => Participant::GUEST,
+ 'publishingPermissions' => Attendee::PUBLISHING_PERMISSIONS_NONE,
],
],
],