Skip to content

Commit

Permalink
fix(setting): Show setting only with HPB and adjust condition for bei…
Browse files Browse the repository at this point in the history
…ng able to enable it

Signed-off-by: Joas Schilling <[email protected]>
  • Loading branch information
nickvergessen committed Jan 15, 2025
1 parent 763c3ce commit be36816
Showing 1 changed file with 25 additions and 22 deletions.
47 changes: 25 additions & 22 deletions src/components/AdminSettings/GeneralSettings.vue
Original file line number Diff line number Diff line change
Expand Up @@ -39,24 +39,26 @@
{{ t('spreed', 'Allow conversations on public shares for files') }}
</NcCheckboxRadioSwitch>

<h3>
{{ t('spreed', 'End-to-end encrypted calls') }}
<small>{{ t('spreed', 'Beta') }}</small>
</h3>

<NcCheckboxRadioSwitch v-model="isE2EECallsEnabled"
type="switch"
:disabled="loading || !canEnableE2EE"
@update:model-value="updateE2EECallsEnabled">
{{ t('spreed', 'Enable encryption') }}
</NcCheckboxRadioSwitch>

<NcNoteCard v-if="!canEnableE2EE"
type="warning"
:text="t('spreed', 'End-to-end encryption is only possible with a High-performance backend or feature is missing.')" />
<NcNoteCard v-else
type="warning"
:text="t('spreed', 'Mobile clients do not support end-to-end encrypted calls at the moment.')" />
<template v-if="hasSignalingServers">
<h3>
{{ t('spreed', 'End-to-end encrypted calls') }}
<small>{{ t('spreed', 'Beta') }}</small>
</h3>

<NcCheckboxRadioSwitch v-model="isE2EECallsEnabled"
type="switch"
:disabled="loading || !canEnableE2EECalls"
@update:model-value="updateE2EECallsEnabled">
{{ t('spreed', 'Enable encryption') }}
</NcCheckboxRadioSwitch>

<NcNoteCard v-if="!canEnableE2EECalls"
type="warning"
:text="t('spreed', 'End-to-end encrypted calls with a configured SIP bridge require a newer version of the High-performance backend and SIP bridge.')" />
<NcNoteCard v-else
type="warning"
:text="t('spreed', 'Mobile clients do not support end-to-end encrypted calls at the moment.')" />
</template>
</section>
</template>

Expand Down Expand Up @@ -96,9 +98,10 @@ export default {
conversationsFiles: parseInt(loadState('spreed', 'conversations_files')) === 1,
conversationsFilesPublicShares: parseInt(loadState('spreed', 'conversations_files_public_shares')) === 1,

hasE2EEFeature: false,
hasFeatureJoinFeatures: false,
hasSignalingServers: false,
isE2EECallsEnabled: false,
hasSIPBridge: false, // FIXME Based on loadState('spreed', 'sip_bridge_shared_secret') but should update with live data?
}
},

Expand All @@ -109,8 +112,8 @@ export default {
isConversationsFilesPublicSharesChecked() {
return this.conversationsFilesPublicShares
},
canEnableE2EE() {
return this.hasE2EEFeature && this.hasSignalingServers
canEnableE2EECalls() {
return this.hasFeatureJoinFeatures || !this.hasSIPBridge
},
},

Expand Down Expand Up @@ -138,7 +141,7 @@ export default {
},

updateSignalingDetails(signaling) {
this.hasE2EEFeature = signaling.hasFeature('join-features')
this.hasFeatureJoinFeatures = signaling.hasFeature('join-features')
},

updateE2EECallsEnabled(value) {
Expand Down

0 comments on commit be36816

Please sign in to comment.