diff options
author | Jakob Röhrl <jakob.roehrl@web.de> | 2020-10-28 14:32:29 +0300 |
---|---|---|
committer | Jakob Röhrl <jakob.roehrl@web.de> | 2020-10-28 16:15:30 +0300 |
commit | a6339458654eda82c11ed9f3cef5e2255c0230e6 (patch) | |
tree | 2af71a932503caf99999279a2f74ddcd2c3ca98b | |
parent | 89be53def7c96ae72dc6bebdecf7e1eb0df417d1 (diff) |
change chat and show quoted msgenh/privateReply
Signed-off-by: Jakob Röhrl <jakob.roehrl@web.de>
-rw-r--r-- | src/components/MessagesList/MessagesGroup/Message/Message.vue | 33 |
1 files changed, 16 insertions, 17 deletions
diff --git a/src/components/MessagesList/MessagesGroup/Message/Message.vue b/src/components/MessagesList/MessagesGroup/Message/Message.vue index 189cfd841..fbe259d58 100644 --- a/src/components/MessagesList/MessagesGroup/Message/Message.vue +++ b/src/components/MessagesList/MessagesGroup/Message/Message.vue @@ -65,7 +65,7 @@ the main body of the message as well as a quote. v-if="isReplyable" icon="icon-reply" :close-after-click="true" - @click.stop="handleReply"> + @click.stop="handleReply(token)"> {{ t('spreed', 'Reply') }} </ActionButton> <ActionButton @@ -95,6 +95,8 @@ import { EventBus } from '../../../../services/EventBus' import emojiRegex from 'emoji-regex' import { PARTICIPANT, CONVERSATION } from '../../../../constants' import moment from '@nextcloud/moment' +import { createOneToOneConversation } from '../../../../services/conversationsService' +import createTemporaryMessage from '../../../../utils/temporaryMessage' export default { name: 'Message', @@ -353,7 +355,7 @@ export default { }, methods: { - handleReply() { + handleReply(t) { this.$store.dispatch('addMessageToBeReplied', { id: this.id, actorId: this.actorId, @@ -364,24 +366,21 @@ export default { messageType: this.messageType, message: this.message, messageParameters: this.messageParameters, - token: this.token, + token: t, }) EventBus.$emit('focusChatInput') }, - handlePrivateReply() { - this.$store.dispatch('addMessageToBeReplied', { - id: this.id, - actorId: this.actorId, - actorType: this.actorType, - actorDisplayName: this.actorDisplayName, - timestamp: this.timestamp, - systemMessage: this.systemMessage, - messageType: this.messageType, - message: this.message, - messageParameters: this.messageParameters, - token: this.token, - }) - EventBus.$emit('focusChatInput') + async handlePrivateReply() { + // open the 1:1 conversation + const response = await createOneToOneConversation(this.actorId) + const conversation = response.data.ocs.data + this.$store.dispatch('addConversation', conversation) + this.$router.push({ name: 'conversation', params: { token: conversation.token } }).catch(err => console.debug(`Error while pushing the new conversation's route: ${err}`)) + + // quoted message + const temporaryMessage = createTemporaryMessage('> 123', conversation.token) + this.$store.dispatch('addTemporaryMessage', temporaryMessage) + }, handleDelete() { this.$store.dispatch('deleteMessage', this.message) |