Browse Source

fix(federation): hide call-related settings for federated conversations, drop outdated conditions

Signed-off-by: Maksim Sukharev <antreesy.web@gmail.com>
pull/11892/head
Maksim Sukharev 2 years ago
parent
commit
278af54faf
No known key found for this signature in database GPG Key ID: 6349D071889BD1D5
  1. 21
      src/components/ConversationSettings/ConversationSettingsDialog.vue
  2. 13
      src/components/ConversationSettings/NotificationsSettings.vue

21
src/components/ConversationSettings/ConversationSettingsDialog.vue

@ -26,9 +26,7 @@
:open.sync="showSettings"
:show-navigation="true"
:container="container">
<!-- description -->
<NcAppSettingsSection v-if="showDescription"
id="basic-info"
<NcAppSettingsSection id="basic-info"
:name="t('spreed', 'Basic Info')">
<BasicInfo :conversation="conversation"
:can-full-moderate="canFullModerate" />
@ -39,7 +37,8 @@
<NcAppSettingsSection v-if="!isNoteToSelf"
id="notifications"
:name="t('spreed', 'Personal')">
<NcCheckboxRadioSwitch type="switch"
<NcCheckboxRadioSwitch v-if="showMediaSettingsToggle"
type="switch"
:disabled="recordingConsentRequired"
:checked="showMediaSettings"
@update:checked="setShowMediaSettings">
@ -138,6 +137,7 @@ import { useSettingsStore } from '../../stores/settings.js'
const recordingEnabled = getCapabilities()?.spreed?.config?.call?.recording || false
const recordingConsentCapability = getCapabilities()?.spreed?.features?.includes('recording-consent')
const recordingConsent = getCapabilities()?.spreed?.config?.call?.['recording-consent'] !== CALL.RECORDING_CONSENT.OFF
const supportFederationV1 = getCapabilities()?.spreed?.features?.includes('federation-v1')
export default {
name: 'ConversationSettingsDialog',
@ -196,6 +196,10 @@ export default {
|| this.$store.getters.getToken()
},
showMediaSettingsToggle() {
return (!supportFederationV1 || !this.conversation.remoteServer)
},
showMediaSettings() {
return this.settingsStore.getShowMediaSettings(this.token)
},
@ -226,15 +230,6 @@ export default {
return this.conversation.canLeaveConversation
},
showDescription() {
if (this.canFullModerate) {
return this.conversation.type !== CONVERSATION.TYPE.ONE_TO_ONE
&& this.conversation.type !== CONVERSATION.TYPE.ONE_TO_ONE_FORMER
} else {
return this.description !== ''
}
},
isBreakoutRoom() {
return this.conversation.objectType === CONVERSATION.OBJECT_TYPE.BREAKOUT_ROOM
},

13
src/components/ConversationSettings/NotificationsSettings.vue

@ -38,7 +38,8 @@
</span>
</NcCheckboxRadioSwitch>
<NcCheckboxRadioSwitch id="notification_calls"
<NcCheckboxRadioSwitch v-if="showCallNotificationSettings"
id="notification_calls"
type="switch"
:checked.sync="notifyCalls"
@update:checked="setNotificationCalls">
@ -52,10 +53,14 @@ import Account from 'vue-material-design-icons/Account.vue'
import VolumeHigh from 'vue-material-design-icons/VolumeHigh.vue'
import VolumeOff from 'vue-material-design-icons/VolumeOff.vue'
import { getCapabilities } from '@nextcloud/capabilities'
import NcCheckboxRadioSwitch from '@nextcloud/vue/dist/Components/NcCheckboxRadioSwitch.js'
import { PARTICIPANT } from '../../constants.js'
const supportFederationV1 = getCapabilities()?.spreed?.features?.includes('federation-v1')
const notificationLevels = [
{ value: PARTICIPANT.NOTIFY.ALWAYS, label: t('spreed', 'All messages') },
{ value: PARTICIPANT.NOTIFY.MENTION, label: t('spreed', '@-mentions only') },
@ -89,6 +94,12 @@ export default {
}
},
computed: {
showCallNotificationSettings() {
return (!supportFederationV1 || !this.conversation.remoteServer)
}
},
methods: {
notificationLevelIcon(value) {
switch (value) {

Loading…
Cancel
Save