|
@@ -7,6 +7,7 @@ import { FieldTextStateless as TextField } from '@atlaskit/field-text';
|
7
|
7
|
import { createE2EEEvent, sendAnalytics } from '../../analytics';
|
8
|
8
|
import { Dialog } from '../../base/dialog';
|
9
|
9
|
import { translate, translateToHTML } from '../../base/i18n';
|
|
10
|
+import { getParticipants } from '../../base/participants';
|
10
|
11
|
import { connect } from '../../base/redux';
|
11
|
12
|
|
12
|
13
|
import { setE2EEKey } from '../actions';
|
|
@@ -14,6 +15,11 @@ import { setE2EEKey } from '../actions';
|
14
|
15
|
|
15
|
16
|
type Props = {
|
16
|
17
|
|
|
18
|
+ /**
|
|
19
|
+ * Indicates whether all participants in the conference currently support E2EE.
|
|
20
|
+ */
|
|
21
|
+ _everyoneSupportsE2EE: boolean,
|
|
22
|
+
|
17
|
23
|
/**
|
18
|
24
|
* The current E2EE key.
|
19
|
25
|
*/
|
|
@@ -70,7 +76,7 @@ class E2EEDialog extends Component<Props, State> {
|
70
|
76
|
* @returns {ReactElement}
|
71
|
77
|
*/
|
72
|
78
|
render() {
|
73
|
|
- const { t } = this.props;
|
|
79
|
+ const { _everyoneSupportsE2EE, t } = this.props;
|
74
|
80
|
|
75
|
81
|
return (
|
76
|
82
|
<Dialog
|
|
@@ -81,6 +87,12 @@ class E2EEDialog extends Component<Props, State> {
|
81
|
87
|
<div className = 'e2ee-destription'>
|
82
|
88
|
{ translateToHTML(t, 'dialog.e2eeDescription') }
|
83
|
89
|
</div>
|
|
90
|
+ {
|
|
91
|
+ !_everyoneSupportsE2EE
|
|
92
|
+ && <div className = 'e2ee-warn'>
|
|
93
|
+ { translateToHTML(t, 'dialog.e2eeWarning') }
|
|
94
|
+ </div>
|
|
95
|
+ }
|
84
|
96
|
<TextField
|
85
|
97
|
autoFocus = { true }
|
86
|
98
|
compact = { true }
|
|
@@ -133,8 +145,10 @@ class E2EEDialog extends Component<Props, State> {
|
133
|
145
|
*/
|
134
|
146
|
function mapStateToProps(state) {
|
135
|
147
|
const { e2eeKey } = state['features/e2ee'];
|
|
148
|
+ const participants = getParticipants(state).filter(p => !p.local);
|
136
|
149
|
|
137
|
150
|
return {
|
|
151
|
+ _everyoneSupportsE2EE: participants.every(p => Boolean(p.e2eeSupported)),
|
138
|
152
|
_key: e2eeKey || ''
|
139
|
153
|
};
|
140
|
154
|
}
|