diff options
author | Daniel Calviño Sánchez <danxuliu@gmail.com> | 2021-02-09 02:12:15 +0100 |
---|---|---|
committer | Daniel Calviño Sánchez <danxuliu@gmail.com> | 2021-09-02 00:17:17 +0200 |
commit | 585cb8500bbfff911117b0e10f6da281acff34af (patch) | |
tree | bb8773fd77e155fbfa933cd5e24bf5f6a742e25d | |
parent | b3702a1ab4f9e5f537d5185a308c016b45e44861 (diff) |
Use peer data to hide listeners if participant data is not availablehide-participants-without-publishing-permissions-in-call-view
Guests can not fetch the full participant list, so the participant store
is empty when the current user is a guest. However, guests can fetch the
peer data, so now that data is used when the participant data is not
available to find out if another participant has publishing permissions
or not and hide her if needed in the call view.
The peer data is extended with "publishing permissions" and it is also
updated on "participantListChanged" events emitted by the signaling, as
until now it was updated only if it was required by a Video element but
it was not available.
Signed-off-by: Daniel Calviño Sánchez <danxuliu@gmail.com>
-rw-r--r-- | docs/call.md | 1 | ||||
-rw-r--r-- | lib/Controller/CallController.php | 1 | ||||
-rw-r--r-- | src/components/CallView/CallView.vue | 10 |
3 files changed, 11 insertions, 1 deletions
diff --git a/docs/call.md b/docs/call.md index fba81dfe8..2f270def9 100644 --- a/docs/call.md +++ b/docs/call.md @@ -28,6 +28,7 @@ `displayName` | string | v3 | | The display name of the attendee `lastPing` | int | v1 | | Timestamp of the last ping of the user (should be used for sorting) `sessionId` | string | v1 | | 512 character long string + `publishingPermissions` | int | v4 | Publishing permissions for the participant (see [constants list](constants.md#participant-publishing-permissions)) ## Join a call diff --git a/lib/Controller/CallController.php b/lib/Controller/CallController.php index c17d8f1ab..2863f13c0 100644 --- a/lib/Controller/CallController.php +++ b/lib/Controller/CallController.php @@ -93,6 +93,7 @@ class CallController extends AEnvironmentAwareController { 'token' => $this->room->getToken(), 'lastPing' => $participant->getSession()->getLastPing(), 'sessionId' => $participant->getSession()->getSessionId(), + 'publishingPermissions' => $participant->getAttendee()->getPublishingPermissions(), ]; } diff --git a/src/components/CallView/CallView.vue b/src/components/CallView/CallView.vue index 523218610..6330f9cb8 100644 --- a/src/components/CallView/CallView.vue +++ b/src/components/CallView/CallView.vue @@ -232,7 +232,12 @@ export default { const participantIndex = this.$store.getters.getParticipantIndex(this.token, { sessionId: nextcloudSessionId }) if (participantIndex === -1) { - return false + const peerData = this.$store.getters.getPeer(this.token, nextcloudSessionId) + if (!peerData) { + return false + } + + return peerData.publishingPermissions !== PARTICIPANT.PUBLISHING_PERMISSIONS.NONE } const participant = this.$store.getters.getParticipant(this.token, participantIndex) @@ -451,6 +456,8 @@ export default { }, mounted() { EventBus.$on('refresh-peer-list', this.debounceFetchPeers) + EventBus.$on('Signaling::participantListChanged', this.debounceFetchPeers) + this.debounceFetchPeers() callParticipantCollection.on('remove', this._lowerHandWhenParticipantLeaves) @@ -458,6 +465,7 @@ export default { }, beforeDestroy() { EventBus.$off('refresh-peer-list', this.debounceFetchPeers) + EventBus.$off('Signaling::participantListChanged', this.debounceFetchPeers) callParticipantCollection.off('remove', this._lowerHandWhenParticipantLeaves) |