Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Commit

Permalink
Prompt for ICE server fallback permission
Browse files Browse the repository at this point in the history
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 element-hq/element-web#10173
  • Loading branch information
jryans committed Aug 15, 2019
1 parent 4afed0f commit c1378f8
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
31 changes: 31 additions & 0 deletions src/components/structures/MatrixChat.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
4 changes: 4 additions & 0 deletions src/i18n/strings/en_EN.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit c1378f8

Please sign in to comment.