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
diff options
context:
space:
mode:
authorJoachim Bauch <bauch@struktur.de>2018-05-08 12:04:00 +0300
committerJoachim Bauch <bauch@struktur.de>2018-05-08 12:41:22 +0300
commit98b429e8d5c2a9a9470cea476b3335f52615e2cf (patch)
treec55d0009bc66ff2efdcd3315aaf011552047bddf /lib/Signaling
parent0321133f11581942d6c4188479ff6e2d1c52b606 (diff)
Notify standalone signaling backend when a guest name is changed.
Signed-off-by: Joachim Bauch <bauch@struktur.de>
Diffstat (limited to 'lib/Signaling')
-rw-r--r--lib/Signaling/BackendNotifier.php36
1 files changed, 36 insertions, 0 deletions
diff --git a/lib/Signaling/BackendNotifier.php b/lib/Signaling/BackendNotifier.php
index aa9ebf5ec..9efc5bc6f 100644
--- a/lib/Signaling/BackendNotifier.php
+++ b/lib/Signaling/BackendNotifier.php
@@ -213,6 +213,42 @@ class BackendNotifier{
}
/**
+ * The participant list of the given room has been modified.
+ *
+ * @param Room $room
+ * @throws \Exception
+ */
+ public function participantsModified($room, $sessionIds) {
+ $this->logger->info('Room participants modified: ' . $room->getToken() . ' ' . print_r($sessionIds, true), ['app' => 'spreed']);
+ $changed = [];
+ $users = [];
+ $participants = $room->getParticipants();
+ foreach ($participants['users'] as $userId => $participant) {
+ $participant['userId'] = $userId;
+ $users[] = $participant;
+ if (in_array($participant['sessionId'], $sessionIds)) {
+ $changed[] = $participant;
+ }
+ }
+ foreach ($participants['guests'] as $participant) {
+ if (!isset($participant['participantType'])) {
+ $participant['participantType'] = Participant::GUEST;
+ }
+ $users[] = $participant;
+ if (in_array($participant['sessionId'], $sessionIds)) {
+ $changed[] = $participant;
+ }
+ }
+ $this->backendRequest('/api/v1/room/' . $room->getToken(), [
+ 'type' => 'participants',
+ 'participants' => [
+ 'changed' => $changed,
+ 'users' => $users
+ ],
+ ]);
+ }
+
+ /**
* The "in-call" status of the given session ids has changed..
*
* @param Room $room