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
This commit is contained in:
J. Ryan Stinnett 2019-08-13 15:50:36 +01:00
parent 4afed0fab4
commit c1378f8e0b
2 changed files with 35 additions and 0 deletions

View file

@ -1370,6 +1370,37 @@ export default React.createClass({
call: call,
}, true);
});
cli.on('Call.noTURNServers', () => {
const QuestionDialog = sdk.getComponent("dialogs.QuestionDialog");
const code = sub => <code>{sub}</code>;
Modal.createTrackedDialog('No TURN servers', '', QuestionDialog, {
title: _t('Homeserver not configured to support calls'),
description: <div>
<p>{ _t(
"Your homeserver <code>%(homeserverDomain)s</code> 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 },
) }</p>
<p>{ _t(
"Riot can use a fallback server <code>turn.matrix.org</code> " +
"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 },
)}</p>
</div>,
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;

View file

@ -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 <code>%(homeserverDomain)s</code> 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 <code>%(homeserverDomain)s</code> 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 <code>turn.matrix.org</code> 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 <code>turn.matrix.org</code> 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",