From 08c34c49aae40ba3d7b7e919b60f27700d5a30d2 Mon Sep 17 00:00:00 2001 From: DorraJaouad Date: Fri, 19 Apr 2024 16:04:42 +0200 Subject: [PATCH] fix(MessageBody): restrict message editing in one-to-one conversation to self messages only Signed-off-by: DorraJaouad Signed-off-by: Maksim Sukharev --- .../Message/MessageButtonsBar/MessageButtonsBar.vue | 7 ++++++- .../MessagesGroup/Message/MessagePart/MessageBody.vue | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/components/MessagesList/MessagesGroup/Message/MessageButtonsBar/MessageButtonsBar.vue b/src/components/MessagesList/MessagesGroup/Message/MessageButtonsBar/MessageButtonsBar.vue index f357b531f97..e05fdf67583 100644 --- a/src/components/MessagesList/MessagesGroup/Message/MessageButtonsBar/MessageButtonsBar.vue +++ b/src/components/MessagesList/MessagesGroup/Message/MessageButtonsBar/MessageButtonsBar.vue @@ -519,9 +519,14 @@ export default { return !this.isConversationReadOnly && this.conversation.participantType !== PARTICIPANT.TYPE.GUEST }, + isOneToOne() { + return this.conversation.type === CONVERSATION.TYPE.ONE_TO_ONE + || this.conversation.type === CONVERSATION.TYPE.ONE_TO_ONE_FORMER + }, + isEditable() { if (!canEditMessage || !this.isModifiable || this.isObjectShare - || (!this.$store.getters.isModerator && !this.isMyMsg)) { + || ((!this.$store.getters.isModerator || this.isOneToOne) && !this.isMyMsg)) { return false } diff --git a/src/components/MessagesList/MessagesGroup/Message/MessagePart/MessageBody.vue b/src/components/MessagesList/MessagesGroup/Message/MessagePart/MessageBody.vue index b54220b2d11..0dd6f3143ce 100644 --- a/src/components/MessagesList/MessagesGroup/Message/MessagePart/MessageBody.vue +++ b/src/components/MessagesList/MessagesGroup/Message/MessagePart/MessageBody.vue @@ -320,9 +320,14 @@ export default { && this.actorType === this.$store.getters.getActorType() }, + isOneToOne() { + return this.conversation.type === CONVERSATION.TYPE.ONE_TO_ONE + || this.conversation.type === CONVERSATION.TYPE.ONE_TO_ONE_FORMER + }, + isEditable() { if (!canEditMessage || !this.isModifiable || this.isObjectShare - || (!this.$store.getters.isModerator && !this.isMyMsg)) { + || ((!this.$store.getters.isModerator || this.isOneToOne) && !this.isMyMsg)) { return false }