Przeglądaj źródła

feat(e2ee): auto turns on e2ee when one participant enabled it

j8
tmoldovan8x8 4 lat temu
rodzic
commit
1224597ede
No account linked to committer's email address

+ 2
- 2
package-lock.json Wyświetl plik

@@ -10513,8 +10513,8 @@
10513 10513
       }
10514 10514
     },
10515 10515
     "lib-jitsi-meet": {
10516
-      "version": "github:jitsi/lib-jitsi-meet#43c589f4096e0e123f92eca46d4c317f731ebc18",
10517
-      "from": "github:jitsi/lib-jitsi-meet#43c589f4096e0e123f92eca46d4c317f731ebc18",
10516
+      "version": "github:jitsi/lib-jitsi-meet#2b94da12e81626c7b9deb24dd95f8ca2038a2f5a",
10517
+      "from": "github:jitsi/lib-jitsi-meet#2b94da12e81626c7b9deb24dd95f8ca2038a2f5a",
10518 10518
       "requires": {
10519 10519
         "@jitsi/js-utils": "1.0.2",
10520 10520
         "@jitsi/sdp-interop": "1.0.3",

+ 1
- 1
package.json Wyświetl plik

@@ -54,7 +54,7 @@
54 54
     "jquery-i18next": "1.2.1",
55 55
     "js-md5": "0.6.1",
56 56
     "jwt-decode": "2.2.0",
57
-    "lib-jitsi-meet": "github:jitsi/lib-jitsi-meet#43c589f4096e0e123f92eca46d4c317f731ebc18",
57
+    "lib-jitsi-meet": "github:jitsi/lib-jitsi-meet#2b94da12e81626c7b9deb24dd95f8ca2038a2f5a",
58 58
     "libflacjs": "github:mmig/libflac.js#93d37e7f811f01cf7d8b6a603e38bd3c3810907d",
59 59
     "lodash": "4.17.21",
60 60
     "moment": "2.29.1",

+ 8
- 13
react/features/base/participants/middleware.js Wyświetl plik

@@ -1,6 +1,7 @@
1 1
 // @flow
2 2
 
3 3
 import UIEvents from '../../../../service/UI/UIEvents';
4
+import { toggleE2EE } from '../../e2ee/actions';
4 5
 import { NOTIFICATION_TIMEOUT, showNotification } from '../../notifications';
5 6
 import { CALLING, INVITED } from '../../presence-status';
6 7
 import { APP_WILL_MOUNT, APP_WILL_UNMOUNT } from '../app';
@@ -207,7 +208,7 @@ StateListenerRegistry.register(
207 208
     (conference, store) => {
208 209
         if (conference) {
209 210
             const propertyHandlers = {
210
-                'e2eeEnabled': (participant, value) => _e2eeUpdated(store, conference, participant.getId(), value),
211
+                'e2ee.enabled': (participant, value) => _e2eeUpdated(store, conference, participant.getId(), value),
211 212
                 'features_e2ee': (participant, value) =>
212 213
                     store.dispatch(participantUpdated({
213 214
                         conference,
@@ -270,12 +271,16 @@ StateListenerRegistry.register(
270 271
  * @param {Function} dispatch - The Redux dispatch function.
271 272
  * @param {Object} conference - The conference for which we got an update.
272 273
  * @param {string} participantId - The ID of the participant from which we got an update.
273
- * @param {boolean} newValue - The new value of the E2EE enabled     status.
274
+ * @param {boolean} newValue - The new value of the E2EE enabled status.
274 275
  * @returns {void}
275 276
  */
276 277
 function _e2eeUpdated({ dispatch }, conference, participantId, newValue) {
277 278
     const e2eeEnabled = newValue === 'true';
278 279
 
280
+    if (e2eeEnabled) {
281
+        dispatch(toggleE2EE(e2eeEnabled));
282
+    }
283
+
279 284
     dispatch(participantUpdated({
280 285
         conference,
281 286
         id: participantId,
@@ -383,7 +388,7 @@ function _maybePlaySounds({ getState, dispatch }, action) {
383 388
  */
384 389
 function _participantJoinedOrUpdated(store, next, action) {
385 390
     const { dispatch, getState } = store;
386
-    const { participant: { avatarURL, e2eeEnabled, email, id, local, name, raisedHand } } = action;
391
+    const { participant: { avatarURL, email, id, local, name, raisedHand } } = action;
387 392
 
388 393
     // Send an external update of the local participant's raised hand state
389 394
     // if a new raised hand state is defined in the action.
@@ -398,16 +403,6 @@ function _participantJoinedOrUpdated(store, next, action) {
398 403
         }
399 404
     }
400 405
 
401
-    // Send an external update of the local participant's E2EE enabled state
402
-    // if a new state is defined in the action.
403
-    if (typeof e2eeEnabled !== 'undefined') {
404
-        if (local) {
405
-            const { conference } = getState()['features/base/conference'];
406
-
407
-            conference && conference.setLocalParticipantProperty('e2eeEnabled', e2eeEnabled);
408
-        }
409
-    }
410
-
411 406
     // Allow the redux update to go through and compare the old avatar
412 407
     // to the new avatar and emit out change events if necessary.
413 408
     const result = next(action);

+ 1
- 1
react/features/e2ee/middleware.js Wyświetl plik

@@ -38,7 +38,7 @@ MiddlewareRegistry.register(({ dispatch, getState }) => next => action => {
38 38
     case TOGGLE_E2EE: {
39 39
         const conference = getCurrentConference(getState);
40 40
 
41
-        if (conference) {
41
+        if (conference && conference.isE2EEEnabled() !== action.enabled) {
42 42
             logger.debug(`E2EE will be ${action.enabled ? 'enabled' : 'disabled'}`);
43 43
             conference.toggleE2EE(action.enabled);
44 44
 

Ładowanie…
Anuluj
Zapisz