diff --git a/src/components/Editor/AddTalkModal.vue b/src/components/Editor/AddTalkModal.vue index 1da7858abb..3efa82aa92 100644 --- a/src/components/Editor/AddTalkModal.vue +++ b/src/components/Editor/AddTalkModal.vue @@ -192,6 +192,25 @@ export default { this.selectedRoom = conversation }, + /** + * Add the conversation as the event's conference. + * + * @param {string} url The conversation URL + */ + setConference(url) { + const eventComponent = this.calendarObjectInstance?.eventComponent + if (!eventComponent?.addConference) { + return + } + + // Replace an earlier conversation rather than stacking a second one + for (const conference of [...eventComponent.getConferenceList()]) { + eventComponent.deleteProperty(conference) + } + + eventComponent.addConference(url, this.$t('calendar', 'Nextcloud Talk'), ['AUDIO', 'VIDEO', 'CHAT']) + }, + async selectConversation(conversation) { try { const url = generateRoomUrl(conversation) @@ -201,6 +220,8 @@ export default { return } + this.setConference(url) + if ((this.calendarObjectInstance.location ?? '').trim() === '') { this.calendarObjectInstanceStore.changeLocation({ location: url, @@ -258,6 +279,8 @@ export default { throw new Error('Failed to generate URL from token') } + this.setConference(url) + if ((this.calendarObjectInstance.location ?? '').trim() === '') { this.$emit('updateLocation', url) showSuccess(this.$t('calendar', 'Successfully added Talk conversation link to location.'))