Переглянути джерело

Recognises calendar events with conference data.

master
damencho 7 роки тому
джерело
коміт
32798b1a80
1 змінених файлів з 26 додано та 1 видалено
  1. 26
    1
      react/features/google-api/googleApi.web.js

+ 26
- 1
react/features/google-api/googleApi.web.js Переглянути файл

@@ -227,10 +227,35 @@ const googleApi = {
227 227
             id: entry.id,
228 228
             location: entry.location,
229 229
             startDate: entry.start.dateTime,
230
-            title: entry.summary
230
+            title: entry.summary,
231
+            url: this._getConferenceDataVideoUri(entry.conferenceData)
231 232
         };
232 233
     },
233 234
 
235
+    /**
236
+     * Checks conference data for jitsi conference solution and returns
237
+     * its video url.
238
+     *
239
+     * @param {Object} conferenceData - The conference data of the event.
240
+     * @returns {string|undefined} Returns the found video uri or undefined.
241
+     */
242
+    _getConferenceDataVideoUri(conferenceData = {}) {
243
+        try {
244
+            // check conference data coming from calendar addons
245
+            if (conferenceData.parameters.addOnParameters.parameters
246
+                    .conferenceSolutionType === 'jitsi') {
247
+                const videoEntry = conferenceData.entryPoints.find(
248
+                    e => e.entryPointType === 'video');
249
+
250
+                if (videoEntry) {
251
+                    return videoEntry.uri;
252
+                }
253
+            }
254
+        } catch (error) {
255
+            // we don't care about undefined fields
256
+        }
257
+    },
258
+
234 259
     /**
235 260
      * Retrieves calendar entries from all available calendars.
236 261
      *

Завантаження…
Відмінити
Зберегти