Merge pull request #1305 from vector-im/SimonBrandner/feat/e2ee-flag
This commit is contained in:
@@ -38,6 +38,7 @@
|
|||||||
"Download debug logs": "Download debug logs",
|
"Download debug logs": "Download debug logs",
|
||||||
"Element Call Home": "Element Call Home",
|
"Element Call Home": "Element Call Home",
|
||||||
"Element Call is temporarily not end-to-end encrypted while we test scalability.": "Element Call is temporarily not end-to-end encrypted while we test scalability.",
|
"Element Call is temporarily not end-to-end encrypted while we test scalability.": "Element Call is temporarily not end-to-end encrypted while we test scalability.",
|
||||||
|
"Enable end-to-end encryption (password protected calls)": "Enable end-to-end encryption (password protected calls)",
|
||||||
"Exit full screen": "Exit full screen",
|
"Exit full screen": "Exit full screen",
|
||||||
"Expose developer settings in the settings window.": "Expose developer settings in the settings window.",
|
"Expose developer settings in the settings window.": "Expose developer settings in the settings window.",
|
||||||
"Feedback": "Feedback",
|
"Feedback": "Feedback",
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ import { useLocationNavigation } from "../useLocationNavigation";
|
|||||||
import { MatrixInfo, VideoPreview } from "./VideoPreview";
|
import { MatrixInfo, VideoPreview } from "./VideoPreview";
|
||||||
import { E2EEConfig, UserChoices } from "../livekit/useLiveKit";
|
import { E2EEConfig, UserChoices } from "../livekit/useLiveKit";
|
||||||
import { InputField } from "../input/Input";
|
import { InputField } from "../input/Input";
|
||||||
|
import { useEnableE2EE } from "../settings/useSetting";
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
matrixInfo: MatrixInfo;
|
matrixInfo: MatrixInfo;
|
||||||
@@ -40,6 +41,8 @@ export function LobbyView(props: Props) {
|
|||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
useLocationNavigation();
|
useLocationNavigation();
|
||||||
|
|
||||||
|
const [enableE2EE] = useEnableE2EE();
|
||||||
|
|
||||||
const joinCallButtonRef = useRef<HTMLButtonElement>(null);
|
const joinCallButtonRef = useRef<HTMLButtonElement>(null);
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (joinCallButtonRef.current) {
|
if (joinCallButtonRef.current) {
|
||||||
@@ -80,13 +83,15 @@ export function LobbyView(props: Props) {
|
|||||||
matrixInfo={props.matrixInfo}
|
matrixInfo={props.matrixInfo}
|
||||||
onUserChoicesChanged={setUserChoices}
|
onUserChoicesChanged={setUserChoices}
|
||||||
/>
|
/>
|
||||||
<InputField
|
{enableE2EE && (
|
||||||
className={styles.passwordField}
|
<InputField
|
||||||
label={t("Password (if none E2EE, is disabled)")}
|
className={styles.passwordField}
|
||||||
type="text"
|
label={t("Password (if none E2EE, is disabled)")}
|
||||||
onChange={onE2EESharedKeyChanged}
|
type="text"
|
||||||
value={e2eeSharedKey}
|
onChange={onE2EESharedKeyChanged}
|
||||||
/>
|
value={e2eeSharedKey}
|
||||||
|
/>
|
||||||
|
)}
|
||||||
<Trans>
|
<Trans>
|
||||||
<Button
|
<Button
|
||||||
ref={joinCallButtonRef}
|
ref={joinCallButtonRef}
|
||||||
|
|||||||
@@ -34,6 +34,7 @@ import {
|
|||||||
useOptInAnalytics,
|
useOptInAnalytics,
|
||||||
useDeveloperSettingsTab,
|
useDeveloperSettingsTab,
|
||||||
useShowConnectionStats,
|
useShowConnectionStats,
|
||||||
|
useEnableE2EE,
|
||||||
} from "./useSetting";
|
} from "./useSetting";
|
||||||
import { FieldRow, InputField } from "../input/Input";
|
import { FieldRow, InputField } from "../input/Input";
|
||||||
import { Button } from "../button";
|
import { Button } from "../button";
|
||||||
@@ -68,6 +69,7 @@ export const SettingsModal = (props: Props) => {
|
|||||||
useDeveloperSettingsTab();
|
useDeveloperSettingsTab();
|
||||||
const [showConnectionStats, setShowConnectionStats] =
|
const [showConnectionStats, setShowConnectionStats] =
|
||||||
useShowConnectionStats();
|
useShowConnectionStats();
|
||||||
|
const [enableE2EE, setEnableE2EE] = useEnableE2EE();
|
||||||
|
|
||||||
const downloadDebugLog = useDownloadDebugLog();
|
const downloadDebugLog = useDownloadDebugLog();
|
||||||
|
|
||||||
@@ -249,6 +251,18 @@ export const SettingsModal = (props: Props) => {
|
|||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
</FieldRow>
|
</FieldRow>
|
||||||
|
<FieldRow>
|
||||||
|
<InputField
|
||||||
|
id="enableE2EE"
|
||||||
|
name="end-to-end-encryption"
|
||||||
|
label={t("Enable end-to-end encryption (password protected calls)")}
|
||||||
|
type="checkbox"
|
||||||
|
checked={enableE2EE}
|
||||||
|
onChange={(e: ChangeEvent<HTMLInputElement>) =>
|
||||||
|
setEnableE2EE(e.target.checked)
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
</FieldRow>
|
||||||
<FieldRow>
|
<FieldRow>
|
||||||
<Button onPress={downloadDebugLog}>{t("Download debug logs")}</Button>
|
<Button onPress={downloadDebugLog}>{t("Download debug logs")}</Button>
|
||||||
</FieldRow>
|
</FieldRow>
|
||||||
|
|||||||
@@ -104,6 +104,9 @@ export const useDeveloperSettingsTab = () =>
|
|||||||
export const useShowConnectionStats = () =>
|
export const useShowConnectionStats = () =>
|
||||||
useSetting("show-connection-stats", false);
|
useSetting("show-connection-stats", false);
|
||||||
|
|
||||||
|
export const useEnableE2EE = () =>
|
||||||
|
useSetting("enable-end-to-end-encryption", false);
|
||||||
|
|
||||||
export const useDefaultDevices = () =>
|
export const useDefaultDevices = () =>
|
||||||
useSetting("defaultDevices", {
|
useSetting("defaultDevices", {
|
||||||
audioinput: "",
|
audioinput: "",
|
||||||
|
|||||||
Reference in New Issue
Block a user