From 8a4fb72eae20e557e9ec152dd94bbd75e90b8a0f Mon Sep 17 00:00:00 2001 From: Tudor-Ovidiu Avram Date: Thu, 20 Aug 2020 10:25:12 +0300 Subject: [PATCH] feat(branding) allow invite links to be branded --- config.js | 7 +++++++ react/features/base/config/configWhitelist.js | 1 + react/features/base/connection/functions.js | 12 +++++++++++- react/features/dynamic-branding/actions.js | 1 - react/features/dynamic-branding/reducer.js | 4 +++- 5 files changed, 22 insertions(+), 3 deletions(-) diff --git a/config.js b/config.js index c5c47ae0a..35413180a 100644 --- a/config.js +++ b/config.js @@ -626,6 +626,13 @@ var config = { tokenAuthUrl */ + /** + * This property can be used to alter the generated meeting invite links (in combination with a branding domain + * which is retrieved internally by jitsi meet) (e.g. https://meet.jit.si/someMeeting + * can become https://brandedDomain/roomAlias) + */ + // brandingRoomAlias: null, + // List of undocumented settings used in lib-jitsi-meet /** _peerConnStatusOutOfLastNTimeout diff --git a/react/features/base/config/configWhitelist.js b/react/features/base/config/configWhitelist.js index 1c038286f..5abd62c2a 100644 --- a/react/features/base/config/configWhitelist.js +++ b/react/features/base/config/configWhitelist.js @@ -69,6 +69,7 @@ export default [ 'channelLastN', 'constraints', + 'brandingRoomAlias', 'debug', 'debugAudioLevels', 'defaultLanguage', diff --git a/react/features/base/connection/functions.js b/react/features/base/connection/functions.js index e6a93bbf4..47032fcff 100644 --- a/react/features/base/connection/functions.js +++ b/react/features/base/connection/functions.js @@ -54,7 +54,17 @@ export function getInviteURL(stateOrGetState: Function | Object): string { throw new Error('Can not get invite URL - the app is not ready'); } - return getURLWithoutParams(locationURL).href; + const { inviteDomain } = state['features/dynamic-branding']; + const urlWithoutParams = getURLWithoutParams(locationURL); + + if (inviteDomain) { + const meetingId + = state['features/base/config'].brandingRoomAlias || urlWithoutParams.pathname; + + return `${inviteDomain}/${meetingId}`; + } + + return urlWithoutParams.href; } /** diff --git a/react/features/dynamic-branding/actions.js b/react/features/dynamic-branding/actions.js index 153829a66..29f07752f 100644 --- a/react/features/dynamic-branding/actions.js +++ b/react/features/dynamic-branding/actions.js @@ -53,7 +53,6 @@ function setDynamicBrandingData(value) { }; } - /** * Action used to signal the branding elements are ready to be displayed. * diff --git a/react/features/dynamic-branding/reducer.js b/react/features/dynamic-branding/reducer.js index ef9ecf785..2ba4bc12b 100644 --- a/react/features/dynamic-branding/reducer.js +++ b/react/features/dynamic-branding/reducer.js @@ -14,6 +14,7 @@ const DEFAULT_STATE = { backgroundColor: '', backgroundImageUrl: '', customizationReady: false, + inviteDomain: '', logoClickUrl: '', logoImageUrl: '' }; @@ -24,11 +25,12 @@ const DEFAULT_STATE = { ReducerRegistry.register(STORE_NAME, (state = DEFAULT_STATE, action) => { switch (action.type) { case SET_DYNAMIC_BRANDING_DATA: { - const { backgroundColor, backgroundImageUrl, logoClickUrl, logoImageUrl } = action.value; + const { backgroundColor, backgroundImageUrl, inviteDomain, logoClickUrl, logoImageUrl } = action.value; return { backgroundColor, backgroundImageUrl, + inviteDomain, logoClickUrl, logoImageUrl, customizationReady: true