From 32798b1a80f2160550b9125f35c9c16a75e0be57 Mon Sep 17 00:00:00 2001 From: damencho Date: Fri, 7 Dec 2018 14:30:17 +0000 Subject: [PATCH] Recognises calendar events with conference data. --- react/features/google-api/googleApi.web.js | 27 +++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/react/features/google-api/googleApi.web.js b/react/features/google-api/googleApi.web.js index 6e6c5deb8..a05b90fba 100644 --- a/react/features/google-api/googleApi.web.js +++ b/react/features/google-api/googleApi.web.js @@ -227,10 +227,35 @@ const googleApi = { id: entry.id, location: entry.location, startDate: entry.start.dateTime, - title: entry.summary + title: entry.summary, + url: this._getConferenceDataVideoUri(entry.conferenceData) }; }, + /** + * Checks conference data for jitsi conference solution and returns + * its video url. + * + * @param {Object} conferenceData - The conference data of the event. + * @returns {string|undefined} Returns the found video uri or undefined. + */ + _getConferenceDataVideoUri(conferenceData = {}) { + try { + // check conference data coming from calendar addons + if (conferenceData.parameters.addOnParameters.parameters + .conferenceSolutionType === 'jitsi') { + const videoEntry = conferenceData.entryPoints.find( + e => e.entryPointType === 'video'); + + if (videoEntry) { + return videoEntry.uri; + } + } + } catch (error) { + // we don't care about undefined fields + } + }, + /** * Retrieves calendar entries from all available calendars. *