diff --git a/src/PublicShareAuthSidebar.vue b/src/PublicShareAuthSidebar.vue index d8722c82cc9..70efd82a013 100644 --- a/src/PublicShareAuthSidebar.vue +++ b/src/PublicShareAuthSidebar.vue @@ -37,7 +37,6 @@ import { getCurrentUser } from '@nextcloud/auth' import CallView from './components/CallView/CallView' import ChatView from './components/ChatView' -import { PARTICIPANT } from './constants' import { EventBus } from './services/EventBus' import { fetchConversation } from './services/conversationsService' import { @@ -148,7 +147,6 @@ export default { await this.$store.dispatch('joinCall', { token: this.token, participantIdentifier: this.$store.getters.getParticipantIdentifier(), - flags: PARTICIPANT.CALL_FLAG.IN_CALL, }) }, diff --git a/src/components/CallView/CallView.vue b/src/components/CallView/CallView.vue index b0f57c711a5..e77634a520d 100644 --- a/src/components/CallView/CallView.vue +++ b/src/components/CallView/CallView.vue @@ -40,6 +40,7 @@ @switchScreenToId="_switchScreenToId" /> import escapeHtml from 'escape-html' import Tooltip from '@nextcloud/vue/dist/Directives/Tooltip' +import { PARTICIPANT } from '../../constants' import SpeakingWhileMutedWarner from '../../utils/webrtc/SpeakingWhileMutedWarner' export default { @@ -97,6 +98,10 @@ export default { }, props: { + token: { + type: String, + required: true, + }, model: { type: Object, required: true, @@ -122,6 +127,25 @@ export default { computed: { + conversation() { + if (this.$store.getters.conversations[this.token]) { + return this.$store.getters.conversations[this.token] + } + + return { + sessionId: '0', + participantType: this.$store.getters.getUserId() !== null ? PARTICIPANT.TYPE.USER : PARTICIPANT.TYPE.GUEST, + objectType: null, + } + }, + + isScreensharingAllowed() { + return this.conversation.participantType === PARTICIPANT.TYPE.OWNER + || this.conversation.participantType === PARTICIPANT.TYPE.MODERATOR + || this.conversation.objectType === 'share:password' + || this.conversation.objectType === 'file' + }, + audioButtonClass() { return { 'icon-audio': this.model.attributes.audioAvailable && this.model.attributes.audioEnabled, @@ -227,6 +251,7 @@ export default { 'icon-screen': this.model.attributes.localScreen, 'screensharing-disabled': !this.model.attributes.localScreen, 'icon-screen-off': !this.model.attributes.localScreen, + 'no-screensharing-available': !this.isScreensharingAllowed, } }, @@ -235,6 +260,10 @@ export default { return null } + if (!this.isScreensharingAllowed) { + return t('spreed', 'No screensharing') + } + return (this.model.attributes.localScreen || this.splitScreenSharingMenu) ? t('spreed', 'Screensharing options') : t('spreed', 'Enable screensharing') }, @@ -295,6 +324,10 @@ export default { }, toggleScreenSharingMenu() { + if (!this.isScreensharingAllowed) { + return + } + if (!this.model.getWebRtc().capabilities.supportScreenSharing) { if (window.location.protocol === 'https:') { OCP.Toast.message(t('spreed', 'Screen sharing is not supported by your browser.')) @@ -432,7 +465,7 @@ export default { .nameIndicator button.audio-disabled:not(.no-audio-available), .nameIndicator button.video-disabled:not(.no-video-available), -.nameIndicator button.screensharing-disabled { +.nameIndicator button.screensharing-disabled:not(.no-screensharing-available) { &:hover, &:focus { opacity: 1; @@ -440,13 +473,15 @@ export default { } .nameIndicator button.no-audio-available, -.nameIndicator button.no-video-available { +.nameIndicator button.no-video-available, +.nameIndicator button.no-screensharing-available { opacity: .7; cursor: not-allowed; } .nameIndicator button.no-audio-available:active, -.nameIndicator button.no-video-available:active { +.nameIndicator button.no-video-available:active, +.nameIndicator button.no-screensharing-available:active { background-color: transparent; } diff --git a/src/components/CallView/LocalVideo.vue b/src/components/CallView/LocalVideo.vue index e62f68f3012..6eda49da281 100644 --- a/src/components/CallView/LocalVideo.vue +++ b/src/components/CallView/LocalVideo.vue @@ -35,6 +35,7 @@