|
@@ -196,6 +196,9 @@ StateListenerRegistry.register(
|
196
|
196
|
JitsiConferenceEvents.PARTICIPANT_PROPERTY_CHANGED,
|
197
|
197
|
(participant, propertyName, oldValue, newValue) => {
|
198
|
198
|
switch (propertyName) {
|
|
199
|
+ case 'e2eeEnabled':
|
|
200
|
+ _e2eeUpdated(store, conference, participant.getId(), newValue);
|
|
201
|
+ break;
|
199
|
202
|
case 'features_e2ee':
|
200
|
203
|
store.dispatch(participantUpdated({
|
201
|
204
|
conference,
|
|
@@ -218,8 +221,7 @@ StateListenerRegistry.register(
|
218
|
221
|
}));
|
219
|
222
|
break;
|
220
|
223
|
case 'raisedHand': {
|
221
|
|
- _raiseHandUpdated(
|
222
|
|
- store, conference, participant.getId(), newValue);
|
|
224
|
+ _raiseHandUpdated(store, conference, participant.getId(), newValue);
|
223
|
225
|
break;
|
224
|
226
|
}
|
225
|
227
|
default:
|
|
@@ -229,13 +231,34 @@ StateListenerRegistry.register(
|
229
|
231
|
|
230
|
232
|
});
|
231
|
233
|
} else {
|
232
|
|
- // We left the conference, raise hand of the local participant must be updated.
|
233
|
|
- _raiseHandUpdated(
|
234
|
|
- store, conference, undefined, false);
|
|
234
|
+ const localParticipantId = getLocalParticipant(store.getState).getId();
|
|
235
|
+
|
|
236
|
+ // We left the conference, the local participant must be updated.
|
|
237
|
+ _e2eeUpdated(store, conference, localParticipantId, false);
|
|
238
|
+ _raiseHandUpdated(store, conference, localParticipantId, false);
|
235
|
239
|
}
|
236
|
240
|
}
|
237
|
241
|
);
|
238
|
242
|
|
|
243
|
+/**
|
|
244
|
+ * Handles a E2EE enabled status update.
|
|
245
|
+ *
|
|
246
|
+ * @param {Function} dispatch - The Redux dispatch function.
|
|
247
|
+ * @param {Object} conference - The conference for which we got an update.
|
|
248
|
+ * @param {string} participantId - The ID of the participant from which we got an update.
|
|
249
|
+ * @param {boolean} newValue - The new value of the E2EE enabled status.
|
|
250
|
+ * @returns {void}
|
|
251
|
+ */
|
|
252
|
+function _e2eeUpdated({ dispatch }, conference, participantId, newValue) {
|
|
253
|
+ const e2eeEnabled = newValue === 'true';
|
|
254
|
+
|
|
255
|
+ dispatch(participantUpdated({
|
|
256
|
+ conference,
|
|
257
|
+ id: participantId,
|
|
258
|
+ e2eeEnabled
|
|
259
|
+ }));
|
|
260
|
+}
|
|
261
|
+
|
239
|
262
|
/**
|
240
|
263
|
* Initializes the local participant and signals that it joined.
|
241
|
264
|
*
|
|
@@ -331,7 +354,7 @@ function _maybePlaySounds({ getState, dispatch }, action) {
|
331
|
354
|
* @returns {Object} The value returned by {@code next(action)}.
|
332
|
355
|
*/
|
333
|
356
|
function _participantJoinedOrUpdated({ dispatch, getState }, next, action) {
|
334
|
|
- const { participant: { avatarURL, email, id, local, name, raisedHand } } = action;
|
|
357
|
+ const { participant: { avatarURL, e2eeEnabled, email, id, local, name, raisedHand } } = action;
|
335
|
358
|
|
336
|
359
|
// Send an external update of the local participant's raised hand state
|
337
|
360
|
// if a new raised hand state is defined in the action.
|
|
@@ -346,6 +369,16 @@ function _participantJoinedOrUpdated({ dispatch, getState }, next, action) {
|
346
|
369
|
}
|
347
|
370
|
}
|
348
|
371
|
|
|
372
|
+ // Send an external update of the local participant's E2EE enabled state
|
|
373
|
+ // if a new state is defined in the action.
|
|
374
|
+ if (typeof e2eeEnabled !== 'undefined') {
|
|
375
|
+ if (local) {
|
|
376
|
+ const { conference } = getState()['features/base/conference'];
|
|
377
|
+
|
|
378
|
+ conference && conference.setLocalParticipantProperty('e2eeEnabled', e2eeEnabled);
|
|
379
|
+ }
|
|
380
|
+ }
|
|
381
|
+
|
349
|
382
|
// Allow the redux update to go through and compare the old avatar
|
350
|
383
|
// to the new avatar and emit out change events if necessary.
|
351
|
384
|
const result = next(action);
|
|
@@ -378,25 +411,23 @@ function _participantJoinedOrUpdated({ dispatch, getState }, next, action) {
|
378
|
411
|
*
|
379
|
412
|
* @param {Function} dispatch - The Redux dispatch function.
|
380
|
413
|
* @param {Object} conference - The conference for which we got an update.
|
381
|
|
- * @param {string?} participantId - The ID of the participant from which we got an update. If undefined,
|
382
|
|
- * we update the local participant.
|
|
414
|
+ * @param {string} participantId - The ID of the participant from which we got an update.
|
383
|
415
|
* @param {boolean} newValue - The new value of the raise hand status.
|
384
|
416
|
* @returns {void}
|
385
|
417
|
*/
|
386
|
418
|
function _raiseHandUpdated({ dispatch, getState }, conference, participantId, newValue) {
|
387
|
419
|
const raisedHand = newValue === 'true';
|
388
|
|
- const pid = participantId || getLocalParticipant(getState()).id;
|
389
|
420
|
|
390
|
421
|
dispatch(participantUpdated({
|
391
|
422
|
conference,
|
392
|
|
- id: pid,
|
|
423
|
+ id: participantId,
|
393
|
424
|
raisedHand
|
394
|
425
|
}));
|
395
|
426
|
|
396
|
427
|
if (raisedHand) {
|
397
|
428
|
dispatch(showNotification({
|
398
|
429
|
titleArguments: {
|
399
|
|
- name: getParticipantDisplayName(getState, pid)
|
|
430
|
+ name: getParticipantDisplayName(getState, participantId)
|
400
|
431
|
},
|
401
|
432
|
titleKey: 'notify.raisedHand'
|
402
|
433
|
}, NOTIFICATION_TIMEOUT));
|