From 125e90582c862db29951c2741dac524b18c1f3e0 Mon Sep 17 00:00:00 2001 From: Lucas Fialho Zawacki Date: Wed, 18 Jul 2018 18:12:34 -0300 Subject: [PATCH 1/6] Add processing of userdata parameters and correct bug while processing metadata --- .../imports/startup/client/auth.js | 29 +++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/bigbluebutton-html5/imports/startup/client/auth.js b/bigbluebutton-html5/imports/startup/client/auth.js index 896e6370fc..087a2657b9 100755 --- a/bigbluebutton-html5/imports/startup/client/auth.js +++ b/bigbluebutton-html5/imports/startup/client/auth.js @@ -7,6 +7,7 @@ import deviceInfo from '/imports/utils/deviceInfo'; // disconnected and trying to open a new connection const STATUS_CONNECTING = 'connecting'; const METADATA_KEY = 'metadata'; +const CUSTOM_DATA_KEY = 'customdata'; export function joinRouteHandler(nextState, replace, callback) { const { sessionToken } = nextState.location.query; @@ -23,7 +24,7 @@ export function joinRouteHandler(nextState, replace, callback) { .then(response => response.json()) .then(({ response }) => { const { - returncode, meetingID, internalUserID, authToken, logoutUrl, customLogoURL, metadata, + returncode, meetingID, internalUserID, authToken, logoutUrl, customLogoURL, metadata, customdata } = response; if (returncode === 'FAILED') { @@ -32,6 +33,7 @@ export function joinRouteHandler(nextState, replace, callback) { } setCustomLogoUrl(customLogoURL); + const metakeys = metadata.length ? metadata.reduce((acc, meta) => { const key = Object.keys(meta).shift(); @@ -52,8 +54,31 @@ export function joinRouteHandler(nextState, replace, callback) { log('error', `Caught: ${e.message}`); } return { ...acc, [key]: value }; - }) : {}; + }, {}) : {}; + + const customData = customdata.length + ? customdata.reduce((acc, data) => { + const key = Object.keys(data).shift(); + + const handledHTML5Parameters = [ + 'html5recordingbot' + ]; + if (handledHTML5Parameters.indexOf(key) === -1) { + return acc; + } + + let value = data[key]; + try { + value = JSON.parse(value); + } catch (e) { + log('error', `Caught: ${e.message}`); + } + + return { ...acc, [key]: value}; + }, {}) : {}; + SessionStorage.setItem(METADATA_KEY, metakeys); + SessionStorage.setItem(CUSTOM_DATA_KEY, customData); Auth.set(meetingID, internalUserID, authToken, logoutUrl, sessionToken); From ffcf35b7daebbf3e758a17a7f88d312e7934d50c Mon Sep 17 00:00:00 2001 From: Lucas Fialho Zawacki Date: Thu, 19 Jul 2018 14:42:17 -0300 Subject: [PATCH 2/6] react key for screenshare video area --- .../imports/ui/components/screenshare/component.jsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bigbluebutton-html5/imports/ui/components/screenshare/component.jsx b/bigbluebutton-html5/imports/ui/components/screenshare/component.jsx index 433e6adeb0..906e66c6aa 100755 --- a/bigbluebutton-html5/imports/ui/components/screenshare/component.jsx +++ b/bigbluebutton-html5/imports/ui/components/screenshare/component.jsx @@ -29,8 +29,8 @@ export default class ScreenshareComponent extends React.Component { render() { return ( - [!this.state.loaded ? (
) : null, - (