Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5c2432b4 authored by Fahim Salam Chowdhury's avatar Fahim Salam Chowdhury 👽
Browse files

feat: add talk room if attendee count >= 2

parent d8e3c149
Loading
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -82,6 +82,8 @@ import useCalendarsStore from '../../../store/calendars.js'
import useCalendarObjectInstanceStore from '../../../store/calendarObjectInstance.js'
import useSettingsStore from '../../../store/settings.js'
import { mapStores, mapState } from 'pinia'
import axios from '@nextcloud/axios'
import { generateOcsUrl } from '@nextcloud/router'

export default {
	name: 'InviteesList',
@@ -379,6 +381,18 @@ export default {
				member,
			})
			this.recentAttendees.push(email)
			this.addConversationLink()
		},
		addConversationLink() {
			if (!this.calendarObjectInstance.attendees || this.calendarObjectInstance.attendees.length < 2) {
				return
			}

			if (typeof this.calendarObjectInstance.location === 'string' && this.calendarObjectInstance.location.trim() !== '') {
				return
			}

			this.createTalkRoom()
		},
		removeAttendee(attendee) {
			// Remove attendee from participating group
+1 −1
Original line number Diff line number Diff line
@@ -28,7 +28,7 @@ export async function createTalkRoom(eventTitle = null, eventDescription = null,

	try {
		response = await HTTPClient.post(generateOcsUrl('apps/spreed/api/' + apiVersion + '/', 2) + 'room', {
			roomType: 3,
			roomType: 7,
			roomName: eventTitle || t('calendar', 'Talk conversation for event'),
			objectType: 'event',
			objectId: md5(new Date()),