Recognises calendar events with conference data.

This commit is contained in:
damencho 2018-12-07 14:30:17 +00:00 committed by Дамян Минков
parent 2ea856acee
commit 32798b1a80
1 changed files with 26 additions and 1 deletions

View File

@ -227,10 +227,35 @@ const googleApi = {
id: entry.id, id: entry.id,
location: entry.location, location: entry.location,
startDate: entry.start.dateTime, 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. * Retrieves calendar entries from all available calendars.
* *