From fbc561243c81c4e6e6b9e5b61cdec91d847d9b17 Mon Sep 17 00:00:00 2001 From: Maksim Sukharev Date: Thu, 24 Apr 2025 14:52:31 +0200 Subject: [PATCH] fix(conversations): do not add second participant to extended 1-1 twice Signed-off-by: Maksim Sukharev --- src/components/RightSidebar/Participants/ParticipantsTab.vue | 5 ++++- src/store/conversationsStore.js | 3 +-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/components/RightSidebar/Participants/ParticipantsTab.vue b/src/components/RightSidebar/Participants/ParticipantsTab.vue index 56c74f6df5..95d34929dc 100644 --- a/src/components/RightSidebar/Participants/ParticipantsTab.vue +++ b/src/components/RightSidebar/Participants/ParticipantsTab.vue @@ -332,7 +332,10 @@ export default { if (this.isOneToOneConversation) { await this.$store.dispatch('extendOneToOneConversation', { token: this.token, - newParticipants: [participant], + newParticipants: [ + { id: this.conversation.name, source: ATTENDEE.ACTOR_TYPE.USERS, label: this.conversation.displayName }, + participant, + ], }) } else { await addParticipant(this.token, participant.id, participant.source) diff --git a/src/store/conversationsStore.js b/src/store/conversationsStore.js index ab16280e95..e7018f91bf 100644 --- a/src/store/conversationsStore.js +++ b/src/store/conversationsStore.js @@ -1003,13 +1003,12 @@ const actions = { * @param {object} context default store context * @param {object} payload action payload * @param {string} payload.token one-to-one conversation token - * @param {Array} payload.newParticipants selected participants to be added + * @param {Array} payload.newParticipants selected participants to be added (should include second participant form original conversation) */ async extendOneToOneConversation(context, { token, newParticipants }) { const conversation = context.getters.conversation(token) const participants = [ { id: conversation.actorId, source: conversation.actorType, label: context.rootGetters.getDisplayName() }, - { id: conversation.name, source: ATTENDEE.ACTOR_TYPE.USERS, label: conversation.displayName }, ...newParticipants, ] const roomName = getDisplayNamesList(participants.map(participant => participant.label), CONVERSATION.MAX_NAME_LENGTH)