Merge pull request #2063 from matrix-org/dbkr/jitsi_check_scalar_first
Jitsi: Check integrations server before call
This commit is contained in:
commit
0a432dfb8f
2 changed files with 26 additions and 2 deletions
|
@ -62,6 +62,7 @@ import dis from './dispatcher';
|
||||||
import { showUnknownDeviceDialogForCalls } from './cryptodevices';
|
import { showUnknownDeviceDialogForCalls } from './cryptodevices';
|
||||||
import SettingsStore from "./settings/SettingsStore";
|
import SettingsStore from "./settings/SettingsStore";
|
||||||
import WidgetUtils from './utils/WidgetUtils';
|
import WidgetUtils from './utils/WidgetUtils';
|
||||||
|
import ScalarAuthClient from './ScalarAuthClient';
|
||||||
|
|
||||||
global.mxCalls = {
|
global.mxCalls = {
|
||||||
//room_id: MatrixCall
|
//room_id: MatrixCall
|
||||||
|
@ -401,7 +402,29 @@ function _onAction(payload) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function _startCallApp(roomId, type) {
|
async function _startCallApp(roomId, type) {
|
||||||
|
// check for a working intgrations manager. Technically we could put
|
||||||
|
// the state event in anyway, but the resulting widget would then not
|
||||||
|
// work for us. Better that the user knows before everyone else in the
|
||||||
|
// room sees it.
|
||||||
|
const scalarClient = new ScalarAuthClient();
|
||||||
|
let haveScalar = false;
|
||||||
|
try {
|
||||||
|
await scalarClient.connect();
|
||||||
|
haveScalar = scalarClient.hasCredentials();
|
||||||
|
} catch (e) {
|
||||||
|
// fall through
|
||||||
|
}
|
||||||
|
if (!haveScalar) {
|
||||||
|
const ErrorDialog = sdk.getComponent("dialogs.ErrorDialog");
|
||||||
|
|
||||||
|
Modal.createTrackedDialog('Could not connect to the integration server', '', ErrorDialog, {
|
||||||
|
title: _t('Could not connect to the integration server'),
|
||||||
|
description: _t('A conference call could not be started because the intgrations server is not available'),
|
||||||
|
});
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
dis.dispatch({
|
dis.dispatch({
|
||||||
action: 'appsDrawer',
|
action: 'appsDrawer',
|
||||||
show: true,
|
show: true,
|
||||||
|
|
|
@ -39,6 +39,8 @@
|
||||||
"Conference calling is in development and may not be reliable.": "Conference calling is in development and may not be reliable.",
|
"Conference calling is in development and may not be reliable.": "Conference calling is in development and may not be reliable.",
|
||||||
"Failed to set up conference call": "Failed to set up conference call",
|
"Failed to set up conference call": "Failed to set up conference call",
|
||||||
"Conference call failed.": "Conference call failed.",
|
"Conference call failed.": "Conference call failed.",
|
||||||
|
"Could not connect to the integration server": "Could not connect to the integration server",
|
||||||
|
"A conference call could not be started because the intgrations server is not available": "A conference call could not be started because the intgrations server is not available",
|
||||||
"Call in Progress": "Call in Progress",
|
"Call in Progress": "Call in Progress",
|
||||||
"A call is already in progress!": "A call is already in progress!",
|
"A call is already in progress!": "A call is already in progress!",
|
||||||
"Permission Required": "Permission Required",
|
"Permission Required": "Permission Required",
|
||||||
|
@ -712,7 +714,6 @@
|
||||||
"Uploaded on %(date)s by %(user)s": "Uploaded on %(date)s by %(user)s",
|
"Uploaded on %(date)s by %(user)s": "Uploaded on %(date)s by %(user)s",
|
||||||
"Download this file": "Download this file",
|
"Download this file": "Download this file",
|
||||||
"Integrations Error": "Integrations Error",
|
"Integrations Error": "Integrations Error",
|
||||||
"Could not connect to the integration server": "Could not connect to the integration server",
|
|
||||||
"Manage Integrations": "Manage Integrations",
|
"Manage Integrations": "Manage Integrations",
|
||||||
"%(nameList)s %(transitionList)s": "%(nameList)s %(transitionList)s",
|
"%(nameList)s %(transitionList)s": "%(nameList)s %(transitionList)s",
|
||||||
"%(severalUsers)sjoined %(count)s times|other": "%(severalUsers)sjoined %(count)s times",
|
"%(severalUsers)sjoined %(count)s times|other": "%(severalUsers)sjoined %(count)s times",
|
||||||
|
|
Loading…
Reference in a new issue