Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions src/components/Editor/AddTalkModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -201,6 +220,8 @@ export default {
return
}

this.setConference(url)

if ((this.calendarObjectInstance.location ?? '').trim() === '') {
this.calendarObjectInstanceStore.changeLocation({
location: url,
Expand Down Expand Up @@ -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.'))
Expand Down
Loading