Skip to content

Commit

Permalink
fix(MessageBody): restrict message editing in one-to-one conversation…
Browse files Browse the repository at this point in the history
… to self messages only

Signed-off-by: DorraJaouad <dorra.jaoued7@gmail.com>
Signed-off-by: Maksim Sukharev <antreesy.web@gmail.com>
  • Loading branch information
DorraJaouad authored and Antreesy committed Apr 19, 2024
1 parent 2cc99a0 commit 08c34c4
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down

0 comments on commit 08c34c4

Please sign in to comment.