From e2788e0fb23118cc739c048f102e546173b346b0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sa=C3=BAl=20Ibarra=20Corretg=C3=A9?= Date: Mon, 20 Apr 2020 17:04:11 +0200 Subject: [PATCH] e2ee: show warning if not all participants support E2EE Refs: https://github.com/jitsi/lib-jitsi-meet/pull/1108 --- lang/main.json | 1 + react/features/base/participants/middleware.js | 7 +++++++ react/features/e2ee/components/E2EEDialog.js | 16 +++++++++++++++- 3 files changed, 23 insertions(+), 1 deletion(-) diff --git a/lang/main.json b/lang/main.json index 9627930ff..4aee7e6be 100644 --- a/lang/main.json +++ b/lang/main.json @@ -178,6 +178,7 @@ "e2eeDescription": "

End-to-End Encryption is currently EXPERIMENTAL. Please see this post for details.


Please keep in mind that turning on end-to-end encryption will effectively disable server-side provided services such as: recording, live streaming and phone participation. Also keep in mind that the meeting will only work for people joining from browsers with support for insertable streams.

", "e2eeLabel": "Key", "e2eeTitle": "End-to-End Encryption", + "e2eeWarning": "

WARNING: Not all participants in this meeting seem to have support for End-to-End encryption. If you enable it they won't be able to see nor hear you.

", "enterDisplayName": "Please enter your name here", "error": "Error", "externalInstallationMsg": "You need to install our desktop sharing extension.", diff --git a/react/features/base/participants/middleware.js b/react/features/base/participants/middleware.js index 57c0d26fd..9edb6ce7d 100644 --- a/react/features/base/participants/middleware.js +++ b/react/features/base/participants/middleware.js @@ -196,6 +196,13 @@ StateListenerRegistry.register( JitsiConferenceEvents.PARTICIPANT_PROPERTY_CHANGED, (participant, propertyName, oldValue, newValue) => { switch (propertyName) { + case 'features_e2ee': + store.dispatch(participantUpdated({ + conference, + id: participant.getId(), + e2eeSupported: newValue + })); + break; case 'features_jigasi': store.dispatch(participantUpdated({ conference, diff --git a/react/features/e2ee/components/E2EEDialog.js b/react/features/e2ee/components/E2EEDialog.js index fba5f850f..c7d0c43f0 100644 --- a/react/features/e2ee/components/E2EEDialog.js +++ b/react/features/e2ee/components/E2EEDialog.js @@ -7,6 +7,7 @@ import { FieldTextStateless as TextField } from '@atlaskit/field-text'; import { createE2EEEvent, sendAnalytics } from '../../analytics'; import { Dialog } from '../../base/dialog'; import { translate, translateToHTML } from '../../base/i18n'; +import { getParticipants } from '../../base/participants'; import { connect } from '../../base/redux'; import { setE2EEKey } from '../actions'; @@ -14,6 +15,11 @@ import { setE2EEKey } from '../actions'; type Props = { + /** + * Indicates whether all participants in the conference currently support E2EE. + */ + _everyoneSupportsE2EE: boolean, + /** * The current E2EE key. */ @@ -70,7 +76,7 @@ class E2EEDialog extends Component { * @returns {ReactElement} */ render() { - const { t } = this.props; + const { _everyoneSupportsE2EE, t } = this.props; return ( {
{ translateToHTML(t, 'dialog.e2eeDescription') }
+ { + !_everyoneSupportsE2EE + &&
+ { translateToHTML(t, 'dialog.e2eeWarning') } +
+ } { */ function mapStateToProps(state) { const { e2eeKey } = state['features/e2ee']; + const participants = getParticipants(state).filter(p => !p.local); return { + _everyoneSupportsE2EE: participants.every(p => Boolean(p.e2eeSupported)), _key: e2eeKey || '' }; }