Skip to content

Commit

Permalink
force show MediaSettings if consent is required
Browse files Browse the repository at this point in the history
Signed-off-by: Maksim Sukharev <antreesy.web@gmail.com>
  • Loading branch information
Antreesy committed Oct 17, 2023
1 parent 33d04c0 commit 688edc3
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,14 @@
id="notifications"
:name="t('spreed', 'Personal')">
<NcCheckboxRadioSwitch type="switch"
:disabled="conversation.recordingConsent"
:checked="showMediaSettings"
@update:checked="setShowMediaSettings">
{{ t('spreed', 'Always show the device preview screen before joining a call in this conversation.') }}
</NcCheckboxRadioSwitch>

<p v-if="conversation.recordingConsent">
{{ t('spreed', 'The consent to be recorded will be required for each participant before joining every call.') }}
</p>
<NotificationsSettings :conversation="conversation" />
</NcAppSettingsSection>

Expand Down
18 changes: 7 additions & 11 deletions src/components/MediaSettings/MediaSettings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,8 @@

<!-- "Always show" setting -->
<NcCheckboxRadioSwitch class="checkbox"
:checked="showMediaSettings"
:checked="showMediaSettings || showRecordingWarning"
:disabled="showRecordingWarning"
@update:checked="setShowMediaSettings">
{{ t('spreed', 'Always show preview for this conversation') }}
</NcCheckboxRadioSwitch>
Expand All @@ -135,7 +136,7 @@

<!-- Recording warning -->
<NcNoteCard v-if="showRecordingWarning" type="warning">
<p v-if="isStartingRecording || isRecording">
<p v-if="isCurrentlyRecording">
<strong>{{ t('spreed', 'The call is being recorded.') }}</strong>
</p>
<p v-else>
Expand Down Expand Up @@ -356,14 +357,9 @@ export default {
return this.conversation.hasCall || this.conversation.hasCallOverwrittenByChat
},

isStartingRecording() {
return this.conversation.callRecording === CALL.RECORDING.VIDEO_STARTING
|| this.conversation.callRecording === CALL.RECORDING.AUDIO_STARTING
},

isRecording() {
return this.conversation.callRecording === CALL.RECORDING.VIDEO
|| this.conversation.callRecording === CALL.RECORDING.AUDIO
isCurrentlyRecording() {
return [CALL.RECORDING.VIDEO_STARTING, CALL.RECORDING.AUDIO_STARTING,
CALL.RECORDING.VIDEO, CALL.RECORDING.AUDIO].includes(this.conversation.callRecording)
},

canFullModerate() {
Expand All @@ -381,7 +377,7 @@ export default {
},

showRecordingWarning() {
return !this.isInCall && (this.isStartingRecording || this.isRecording || this.isRecordingConsentRequired)
return !this.isInCall && (this.isCurrentlyRecording || this.isRecordingConsentRequired)
},

showSilentCallOption() {
Expand Down
14 changes: 5 additions & 9 deletions src/components/TopBar/CallButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -188,14 +188,10 @@ export default {
return this.$store.getters.conversation(this.token) || this.$store.getters.dummyConversation
},

isStartingRecording() {
return this.conversation.callRecording === CALL.RECORDING.VIDEO_STARTING
|| this.conversation.callRecording === CALL.RECORDING.AUDIO_STARTING
},

isRecording() {
return this.conversation.callRecording === CALL.RECORDING.VIDEO
|| this.conversation.callRecording === CALL.RECORDING.AUDIO
showRecordingWarning() {
return [CALL.RECORDING.VIDEO_STARTING, CALL.RECORDING.AUDIO_STARTING,
CALL.RECORDING.VIDEO, CALL.RECORDING.AUDIO].includes(this.conversation.callRecording)
|| this.conversation.recordingConsent === CALL.RECORDING_CONSENT.REQUIRED
},

showMediaSettings() {
Expand Down Expand Up @@ -371,7 +367,7 @@ export default {
return
}

if (this.isStartingRecording || this.isRecording || this.showMediaSettings) {
if (this.showRecordingWarning || this.showMediaSettings) {
emit('talk:media-settings:show')
} else {
emit('talk:media-settings:hide')
Expand Down

0 comments on commit 688edc3

Please sign in to comment.