diff options
author | Maksim Sukharev <antreesy.web@gmail.com> | 2024-03-11 19:02:10 +0100 |
---|---|---|
committer | Maksim Sukharev <antreesy.web@gmail.com> | 2024-03-13 13:43:41 +0100 |
commit | 5a097ac429d637e59c72ce646b5b6dbb4bc84e98 (patch) | |
tree | 616d50efb8d171a78c42b0f3eeb977f67d25fe6a | |
parent | 3ae964b836369e083d906227e2981aa7e8100a04 (diff) |
fix(federation): hide unsupported features from web interface
Signed-off-by: Maksim Sukharev <antreesy.web@gmail.com>
-rw-r--r-- | src/components/NewMessage/NewMessage.vue | 7 | ||||
-rw-r--r-- | src/components/RightSidebar/RightSidebar.vue | 16 | ||||
-rw-r--r-- | src/components/TopBar/CallButton.vue | 4 |
3 files changed, 23 insertions, 4 deletions
diff --git a/src/components/NewMessage/NewMessage.vue b/src/components/NewMessage/NewMessage.vue index 48476cb3a..181cda13b 100644 --- a/src/components/NewMessage/NewMessage.vue +++ b/src/components/NewMessage/NewMessage.vue @@ -235,6 +235,8 @@ import { parseSpecialSymbols } from '../../utils/textParse.ts' const disableKeyboardShortcuts = OCP.Accessibility.disableKeyboardShortcuts() const supportTypingStatus = getCapabilities()?.spreed?.config?.chat?.['typing-privacy'] !== undefined const canEditMessage = getCapabilities()?.spreed?.features?.includes('edit-messages') +const attachmentsAllowed = getCapabilities()?.spreed?.config?.attachments?.allowed +const supportFederationV1 = getCapabilities()?.spreed?.features?.includes('federation-v1') export default { name: 'NewMessage', @@ -407,17 +409,18 @@ export default { canShareFiles() { return !this.currentUserIsGuest + && (!supportFederationV1 || !this.conversation.remoteServer) }, canUploadFiles() { - return getCapabilities()?.spreed?.config?.attachments?.allowed + return attachmentsAllowed && this.canShareFiles && this.$store.getters.getAttachmentFolderFreeSpace() !== 0 - && this.canShareFiles }, canCreatePoll() { return !this.isOneToOne && !this.noChatPermission && this.conversation.type !== CONVERSATION.TYPE.NOTE_TO_SELF + && (!supportFederationV1 || !this.conversation.remoteServer) }, currentConversationIsJoined() { diff --git a/src/components/RightSidebar/RightSidebar.vue b/src/components/RightSidebar/RightSidebar.vue index 8c9db3911..69435e851 100644 --- a/src/components/RightSidebar/RightSidebar.vue +++ b/src/components/RightSidebar/RightSidebar.vue @@ -65,7 +65,7 @@ :main-conversation="mainConversation" :is-active="activeTab === 'breakout-rooms'" /> </NcAppSidebarTab> - <NcAppSidebarTab v-if="!getUserId || showSIPSettings" + <NcAppSidebarTab v-if="showDetailsTab" id="details-tab" :order="4" :name="t('spreed', 'Details')"> @@ -87,7 +87,7 @@ </div> </div> </NcAppSidebarTab> - <NcAppSidebarTab v-if="getUserId" + <NcAppSidebarTab v-if="showSharedItemsTab" id="shared-items" ref="sharedItemsTab" :order="5" @@ -108,6 +108,7 @@ import FolderMultipleImage from 'vue-material-design-icons/FolderMultipleImage.v import InformationOutline from 'vue-material-design-icons/InformationOutline.vue' import Message from 'vue-material-design-icons/Message.vue' +import { getCapabilities } from '@nextcloud/capabilities' import { emit, subscribe, unsubscribe } from '@nextcloud/event-bus' import NcAppSidebar from '@nextcloud/vue/dist/Components/NcAppSidebar.js' @@ -125,6 +126,8 @@ import SetGuestUsername from '../SetGuestUsername.vue' import { CONVERSATION, WEBINAR, PARTICIPANT } from '../../constants.js' import BrowserStorage from '../../services/BrowserStorage.js' +const supportFederationV1 = getCapabilities()?.spreed?.features?.includes('federation-v1') + export default { name: 'RightSidebar', components: { @@ -266,6 +269,7 @@ export default { showBreakoutRoomsTab() { return this.getUserId && !this.isOneToOne + && (!supportFederationV1 || !this.conversation.remoteServer) && (this.breakoutRoomsConfigured || this.conversation.breakoutRoomMode === CONVERSATION.BREAKOUT_ROOM_MODE.FREE || this.conversation.objectType === CONVERSATION.OBJECT_TYPE.BREAKOUT_ROOM) }, @@ -273,6 +277,14 @@ export default { return (this.getUserId || this.isModeratorOrUser) && !this.isOneToOne && !this.isNoteToSelf }, + showSharedItemsTab() { + return this.getUserId && (!supportFederationV1 || !this.conversation.remoteServer) + }, + + showDetailsTab() { + return !this.getUserId || this.showSIPSettings + }, + isNoteToSelf() { return this.conversation.type === CONVERSATION.TYPE.NOTE_TO_SELF }, diff --git a/src/components/TopBar/CallButton.vue b/src/components/TopBar/CallButton.vue index 9104e67c8..5cae99142 100644 --- a/src/components/TopBar/CallButton.vue +++ b/src/components/TopBar/CallButton.vue @@ -102,6 +102,7 @@ import VideoBoxOff from 'vue-material-design-icons/VideoBoxOff.vue' import VideoOff from 'vue-material-design-icons/VideoOff.vue' import VideoOutlineIcon from 'vue-material-design-icons/VideoOutline.vue' +import { getCapabilities } from '@nextcloud/capabilities' import { showError } from '@nextcloud/dialogs' import { emit } from '@nextcloud/event-bus' import { loadState } from '@nextcloud/initial-state' @@ -119,6 +120,8 @@ import { useSettingsStore } from '../../stores/settings.js' import { useTalkHashStore } from '../../stores/talkHash.js' import { blockCalls, unsupportedWarning } from '../../utils/browserCheck.js' +const supportFederationV1 = getCapabilities()?.spreed?.features?.includes('federation-v1') + export default { name: 'CallButton', @@ -298,6 +301,7 @@ export default { return this.callEnabled && this.conversation.type !== CONVERSATION.TYPE.NOTE_TO_SELF && this.conversation.readOnly === CONVERSATION.STATE.READ_WRITE + && (!supportFederationV1 || !this.conversation.remoteServer) && !this.isInCall }, |