From cfa7d0f11df42260e964f1f2bce0742ee6e77e25 Mon Sep 17 00:00:00 2001 From: David Baker Date: Tue, 24 Jul 2018 19:06:19 +0100 Subject: [PATCH 1/3] Take jitsi conf calling out of labs --- src/CallHandler.js | 78 +++++++++------------------------------- src/settings/Settings.js | 6 ---- 2 files changed, 17 insertions(+), 67 deletions(-) diff --git a/src/CallHandler.js b/src/CallHandler.js index 9b0a446565..4edc076343 100644 --- a/src/CallHandler.js +++ b/src/CallHandler.js @@ -301,67 +301,7 @@ function _onAction(payload) { break; case 'place_conference_call': console.log("Place conference call in %s", payload.room_id); - - if (SettingsStore.isFeatureEnabled('feature_jitsi')) { - _startCallApp(payload.room_id, payload.type); - } else { - if (MatrixClientPeg.get().isRoomEncrypted(payload.room_id)) { - // Conference calls are implemented by sending the media to central - // server which combines the audio from all the participants together - // into a single stream. This is incompatible with end-to-end encryption - // because a central server would be decrypting the audio for each - // participant. - // Therefore we disable conference calling in E2E rooms. - const ErrorDialog = sdk.getComponent("dialogs.ErrorDialog"); - Modal.createTrackedDialog('Call Handler', 'Conference calls unsupported e2e', ErrorDialog, { - description: _t('Conference calls are not supported in encrypted rooms'), - }); - return; - } - - if (!ConferenceHandler) { - const ErrorDialog = sdk.getComponent("dialogs.ErrorDialog"); - Modal.createTrackedDialog('Call Handler', 'Conference call unsupported client', ErrorDialog, { - description: _t('Conference calls are not supported in this client'), - }); - } else if (!MatrixClientPeg.get().supportsVoip()) { - const ErrorDialog = sdk.getComponent("dialogs.ErrorDialog"); - Modal.createTrackedDialog('Call Handler', 'VoIP is unsupported', ErrorDialog, { - title: _t('VoIP is unsupported'), - description: _t('You cannot place VoIP calls in this browser.'), - }); - } else { - const QuestionDialog = sdk.getComponent("dialogs.QuestionDialog"); - Modal.createTrackedDialog('Call Handler', 'Conference calling in development', QuestionDialog, { - title: _t('Warning!'), - description: _t('Conference calling is in development and may not be reliable.'), - onFinished: (confirm)=>{ - if (confirm) { - ConferenceHandler.createNewMatrixCall( - MatrixClientPeg.get(), payload.room_id, - ).done(function(call) { - placeCall(call); - }, function(err) { - const ErrorDialog = sdk.getComponent("dialogs.ErrorDialog"); - console.error("Conference call failed: " + err); - Modal.createTrackedDialog( - 'Call Handler', - 'Failed to set up conference call', - ErrorDialog, - { - title: _t('Failed to set up conference call'), - description: ( - _t('Conference call failed.') + - ' ' + ((err && err.message) ? err.message : '') - ), - }, - ); - }); - } - }, - }); - } - } + _startCallApp(payload.room_id, payload.type); break; case 'incoming_call': { @@ -543,6 +483,22 @@ const callHandler = { return null; }, + /** + * The conference handler is a module that deals with implementation-specific + * multi-party calling implementations. Riot passes in its own which creates + * a one-to-one call with a freeswitch conference bridge. As of July 2018, + * the de-facto way of conference calling is a Jitsi widget, so this is + * deprecated. It reamins here for two reasons: + * 1. So Riot still supports joining existing freeswitch conference calls + * (but doesn't support creating them). After a transition period, we can + * remove support for joining them too. + * 2. To hide the one-to-one rooms that old-style conferencing creates. This + * is much harder to remove: probably either we make Riot leave & forget these + * rooms after we remove support for joining freeswitch conferences, or we + * accept that random rooms with cryptic users will suddently appear for + * anyone who's ever used conference calling, or we are stuck with this + * code forever. + */ setConferenceHandler: function(confHandler) { ConferenceHandler = confHandler; }, diff --git a/src/settings/Settings.js b/src/settings/Settings.js index 022fabc739..e3f5855f0d 100644 --- a/src/settings/Settings.js +++ b/src/settings/Settings.js @@ -83,12 +83,6 @@ export const SETTINGS = { supportedLevels: LEVELS_FEATURE, default: false, }, - "feature_jitsi": { - isFeature: true, - displayName: _td("Jitsi Conference Calling"), - supportedLevels: LEVELS_FEATURE, - default: false, - }, "MessageComposerInput.dontSuggestEmoji": { supportedLevels: LEVELS_ACCOUNT_SETTINGS, displayName: _td('Disable Emoji suggestions while typing'), From d8be4508e8d599a8fc89449a0a73a4a7cb745693 Mon Sep 17 00:00:00 2001 From: David Baker Date: Tue, 24 Jul 2018 19:13:05 +0100 Subject: [PATCH 2/3] Unused import --- src/CallHandler.js | 1 - 1 file changed, 1 deletion(-) diff --git a/src/CallHandler.js b/src/CallHandler.js index 4edc076343..a05a6f5405 100644 --- a/src/CallHandler.js +++ b/src/CallHandler.js @@ -61,7 +61,6 @@ import Matrix from 'matrix-js-sdk'; import dis from './dispatcher'; import SdkConfig from './SdkConfig'; import { showUnknownDeviceDialogForCalls } from './cryptodevices'; -import SettingsStore from "./settings/SettingsStore"; import WidgetUtils from './utils/WidgetUtils'; import WidgetEchoStore from './stores/WidgetEchoStore'; import ScalarAuthClient from './ScalarAuthClient'; From 20ea86417e7c548785d5728d27a4d946d7d6e6c9 Mon Sep 17 00:00:00 2001 From: David Baker Date: Tue, 24 Jul 2018 19:14:44 +0100 Subject: [PATCH 3/3] Appease the linter --- src/CallHandler.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/CallHandler.js b/src/CallHandler.js index a05a6f5405..acdc3e5122 100644 --- a/src/CallHandler.js +++ b/src/CallHandler.js @@ -497,6 +497,8 @@ const callHandler = { * accept that random rooms with cryptic users will suddently appear for * anyone who's ever used conference calling, or we are stuck with this * code forever. + * + * @param {object} confHandler The conference handler object */ setConferenceHandler: function(confHandler) { ConferenceHandler = confHandler;