From c1378f8e0bc13e9447a1fe59fe842a620a6ce479 Mon Sep 17 00:00:00 2001 From: "J. Ryan Stinnett" Date: Tue, 13 Aug 2019 15:50:36 +0100 Subject: [PATCH] Prompt for ICE server fallback permission This adds a prompt at the start of each session when the homeserver does not have any ICE servers configured. The fallback ICE server is only used if the user allows it. The dialog also recommends notifying the homeserver admin to rectify the issue. Fixes https://github.com/vector-im/riot-web/issues/10173 --- src/components/structures/MatrixChat.js | 31 +++++++++++++++++++++++++ src/i18n/strings/en_EN.json | 4 ++++ 2 files changed, 35 insertions(+) diff --git a/src/components/structures/MatrixChat.js b/src/components/structures/MatrixChat.js index b8903076c76..ff30bb16056 100644 --- a/src/components/structures/MatrixChat.js +++ b/src/components/structures/MatrixChat.js @@ -1370,6 +1370,37 @@ export default React.createClass({ call: call, }, true); }); + cli.on('Call.noTURNServers', () => { + const QuestionDialog = sdk.getComponent("dialogs.QuestionDialog"); + const code = sub => {sub}; + Modal.createTrackedDialog('No TURN servers', '', QuestionDialog, { + title: _t('Homeserver not configured to support calls'), + description:
+

{ _t( + "Your homeserver %(homeserverDomain)s is " + + "currently not configured to assist with calls by offering a " + + "TURN server, which means it is likely that voice and video " + + "calls will fail. Please notify your homeserver administrator " + + "so that they can address this.", + { homeserverDomain: cli.getDomain() }, { code }, + ) }

+

{ _t( + "Riot can use a fallback server turn.matrix.org " + + "for the current session if you urgently need to make a call. " + + "Your IP address would be shared with this fallback server " + + "only if you agree and later place or receive a call.", + null, { code }, + )}

+
, + button: _t('Allow Fallback'), + cancelButton: _t('Dismiss'), + onFinished: (confirmed) => { + if (confirmed) { + cli.setFallbackICEServerAllowed(true); + } + }, + }, null, true); + }); cli.on('Session.logged_out', function(errObj) { if (Lifecycle.isLoggingOut()) return; diff --git a/src/i18n/strings/en_EN.json b/src/i18n/strings/en_EN.json index 0ca1ece48ff..ecfdc5642a2 100644 --- a/src/i18n/strings/en_EN.json +++ b/src/i18n/strings/en_EN.json @@ -1507,6 +1507,10 @@ "Failed to leave room": "Failed to leave room", "Can't leave Server Notices room": "Can't leave Server Notices room", "This room is used for important messages from the Homeserver, so you cannot leave it.": "This room is used for important messages from the Homeserver, so you cannot leave it.", + "Homeserver not configured to support calls": "Homeserver not configured to support calls", + "Your homeserver %(homeserverDomain)s is currently not configured to assist with calls by offering a TURN server, which means it is likely that voice and video calls will fail. Please notify your homeserver administrator so that they can address this.": "Your homeserver %(homeserverDomain)s is currently not configured to assist with calls by offering a TURN server, which means it is likely that voice and video calls will fail. Please notify your homeserver administrator so that they can address this.", + "Riot can use a fallback server turn.matrix.org for the current session if you urgently need to make a call. Your IP address would be shared with this fallback server only if you agree and later place or receive a call.": "Riot can use a fallback server turn.matrix.org for the current session if you urgently need to make a call. Your IP address would be shared with this fallback server only if you agree and later place or receive a call.", + "Allow Fallback": "Allow Fallback", "Signed Out": "Signed Out", "For security, this session has been signed out. Please sign in again.": "For security, this session has been signed out. Please sign in again.", "Terms and Conditions": "Terms and Conditions",