diff options
author | Maksim Sukharev <antreesy.web@gmail.com> | 2024-03-15 10:36:06 +0100 |
---|---|---|
committer | Maksim Sukharev <antreesy.web@gmail.com> | 2024-03-15 10:54:07 +0100 |
commit | 7aa315facde52eb7e280d5f44db4792be159c97a (patch) | |
tree | a4cf1dae567566915e200c7505fd78a148ccfb39 | |
parent | 4b837c0c6f2c74a5ceabe83114c973dd8024abcb (diff) |
fix(plugins): hide federated rooms for message forwarding and rich object posting
Signed-off-by: Maksim Sukharev <antreesy.web@gmail.com>
-rw-r--r-- | src/components/RoomSelector.vue | 5 | ||||
-rw-r--r-- | src/views/FlowPostToConversation.vue | 6 |
2 files changed, 10 insertions, 1 deletions
diff --git a/src/components/RoomSelector.vue b/src/components/RoomSelector.vue index d34e85f99..83aed6f52 100644 --- a/src/components/RoomSelector.vue +++ b/src/components/RoomSelector.vue @@ -69,6 +69,8 @@ import { provide, ref } from 'vue' import Magnify from 'vue-material-design-icons/Magnify.vue' import MessageOutline from 'vue-material-design-icons/MessageOutline.vue' +import { getCapabilities } from '@nextcloud/capabilities' + import NcButton from '@nextcloud/vue/dist/Components/NcButton.js' import NcEmptyContent from '@nextcloud/vue/dist/Components/NcEmptyContent.js' import NcModal from '@nextcloud/vue/dist/Components/NcModal.js' @@ -79,6 +81,8 @@ import ConversationsSearchListVirtual from './LeftSidebar/ConversationsList/Conv import { CONVERSATION } from '../constants.js' import { searchListedConversations, fetchConversations } from '../services/conversationsService.js' +const supportFederationV1 = getCapabilities()?.spreed?.features?.includes('federation-v1') + export default { name: 'RoomSelector', @@ -193,6 +197,7 @@ export default { : await fetchConversations({}) this.rooms = response.data.ocs.data.sort(this.sortConversations) + .filter(conversation => !supportFederationV1 || !conversation.remoteServer) this.loading = false }, diff --git a/src/views/FlowPostToConversation.vue b/src/views/FlowPostToConversation.vue index 3ad7f2353..60dad5a20 100644 --- a/src/views/FlowPostToConversation.vue +++ b/src/views/FlowPostToConversation.vue @@ -16,12 +16,15 @@ <script> import axios from '@nextcloud/axios' +import { getCapabilities } from '@nextcloud/capabilities' import { generateOcsUrl } from '@nextcloud/router' import NcSelect from '@nextcloud/vue/dist/Components/NcSelect.js' import { FLOW, CONVERSATION, PARTICIPANT } from '../constants.js' +const supportFederationV1 = getCapabilities()?.spreed?.features?.includes('federation-v1') + export default { name: 'FlowPostToConversation', components: { NcSelect }, @@ -86,6 +89,7 @@ export default { this.roomOptions = response.data.ocs.data.filter(function(room) { return room.readOnly === CONVERSATION.STATE.READ_WRITE && (room.permissions & PARTICIPANT.PERMISSIONS.CHAT) !== 0 + && (!supportFederationV1 || !room.remoteServer) }) }) }, @@ -95,7 +99,7 @@ export default { </script> <style scoped> - .multiselect { + :deep(.v-select) { width: 100%; margin: auto; text-align: center; |