From 56b25d4302bd189ba4089c1209e995f4975f4fa8 Mon Sep 17 00:00:00 2001 From: Maksim Sukharev Date: Tue, 20 Feb 2024 14:18:33 +0100 Subject: [PATCH 1/2] fix(Forwarder): use native browser navigation outside of Talk Signed-off-by: Maksim Sukharev --- .../Message/MessageButtonsBar/Forwarder.vue | 28 +++++++++++++------ 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/src/components/MessagesList/MessagesGroup/Message/MessageButtonsBar/Forwarder.vue b/src/components/MessagesList/MessagesGroup/Message/MessageButtonsBar/Forwarder.vue index c09e2db6518..e301d35f6cd 100644 --- a/src/components/MessagesList/MessagesGroup/Message/MessageButtonsBar/Forwarder.vue +++ b/src/components/MessagesList/MessagesGroup/Message/MessageButtonsBar/Forwarder.vue @@ -73,6 +73,7 @@ import cloneDeep from 'lodash/cloneDeep.js' import Check from 'vue-material-design-icons/Check.vue' import { showError } from '@nextcloud/dialogs' +import { generateUrl } from '@nextcloud/router' import NcButton from '@nextcloud/vue/dist/Components/NcButton.js' import NcEmptyContent from '@nextcloud/vue/dist/Components/NcEmptyContent.js' @@ -193,17 +194,28 @@ export default { }, openConversation() { + const isTalkApp = IS_DESKTOP || window.location.pathname.includes('/apps/spreed') || window.location.pathname.includes('/call/') + + if (!isTalkApp) { + // Native redirect to Talk from Files sidebar + const url = generateUrl('/call/{token}#message_{messageId}', { + token: this.selectedConversationToken, + messageId: this.forwardedMessageID, + }) + window.open(url, '_blank').focus() + } else { + this.$router.push({ + name: 'conversation', + hash: `#message_${this.forwardedMessageID}`, + params: { + token: `${this.selectedConversationToken}`, + }, + }).catch(err => console.debug(`Error while pushing the new conversation's route: ${err}`)) + } - this.$router.push({ - name: 'conversation', - hash: `#message_${this.forwardedMessageID}`, - params: { - token: `${this.selectedConversationToken}`, - }, - }) - .catch(err => console.debug(`Error while pushing the new conversation's route: ${err}`)) this.showForwardedConfirmation = false this.forwardedMessageID = '' + this.$emit('close') }, handleClose() { From 6695f5af632462b0f75416d08ef33567ad745770 Mon Sep 17 00:00:00 2001 From: Maksim Sukharev Date: Wed, 21 Feb 2024 10:49:28 +0100 Subject: [PATCH 2/2] fix(Forwarder): hide selectedConversationName if not available Signed-off-by: Maksim Sukharev --- .../Message/MessageButtonsBar/Forwarder.vue | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/components/MessagesList/MessagesGroup/Message/MessageButtonsBar/Forwarder.vue b/src/components/MessagesList/MessagesGroup/Message/MessageButtonsBar/Forwarder.vue index e301d35f6cd..1b68799df6f 100644 --- a/src/components/MessagesList/MessagesGroup/Message/MessageButtonsBar/Forwarder.vue +++ b/src/components/MessagesList/MessagesGroup/Message/MessageButtonsBar/Forwarder.vue @@ -21,7 +21,7 @@