external_api: add command to set E2EE key
This commit is contained in:
parent
cb6fbb0f03
commit
33ebd241a9
|
@ -11,6 +11,7 @@ import {
|
||||||
setSubject
|
setSubject
|
||||||
} from '../../react/features/base/conference';
|
} from '../../react/features/base/conference';
|
||||||
import { parseJWTFromURLParams } from '../../react/features/base/jwt';
|
import { parseJWTFromURLParams } from '../../react/features/base/jwt';
|
||||||
|
import { setE2EEKey } from '../../react/features/e2ee';
|
||||||
import { invite } from '../../react/features/invite';
|
import { invite } from '../../react/features/invite';
|
||||||
import { toggleTileView } from '../../react/features/video-layout';
|
import { toggleTileView } from '../../react/features/video-layout';
|
||||||
import { getJitsiMeetTransport } from '../transport';
|
import { getJitsiMeetTransport } from '../transport';
|
||||||
|
@ -166,6 +167,10 @@ function initCommands() {
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
logger.error('Failed sending endpoint text message', err);
|
logger.error('Failed sending endpoint text message', err);
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
'e2ee-key': key => {
|
||||||
|
logger.debug('Set E2EE key command received');
|
||||||
|
APP.store.dispatch(setE2EEKey(key));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
transport.on('event', ({ data, name }) => {
|
transport.on('event', ({ data, name }) => {
|
||||||
|
|
|
@ -29,6 +29,7 @@ const ALWAYS_ON_TOP_FILENAMES = [
|
||||||
const commands = {
|
const commands = {
|
||||||
avatarUrl: 'avatar-url',
|
avatarUrl: 'avatar-url',
|
||||||
displayName: 'display-name',
|
displayName: 'display-name',
|
||||||
|
e2eeKey: 'e2ee-key',
|
||||||
email: 'email',
|
email: 'email',
|
||||||
hangup: 'video-hangup',
|
hangup: 'video-hangup',
|
||||||
password: 'password',
|
password: 'password',
|
||||||
|
@ -236,6 +237,8 @@ export default class JitsiMeetExternalAPI extends EventEmitter {
|
||||||
* information about the initial devices that will be used in the call.
|
* information about the initial devices that will be used in the call.
|
||||||
* @param {Object} [options.userInfo] - Object containing information about
|
* @param {Object} [options.userInfo] - Object containing information about
|
||||||
* the participant opening the meeting.
|
* the participant opening the meeting.
|
||||||
|
* @param {string} [options.e2eeKey] - The key used for End-to-End encryption.
|
||||||
|
* THIS IS EXPERIMENTAL.
|
||||||
*/
|
*/
|
||||||
constructor(domain, ...args) {
|
constructor(domain, ...args) {
|
||||||
super();
|
super();
|
||||||
|
@ -251,7 +254,8 @@ export default class JitsiMeetExternalAPI extends EventEmitter {
|
||||||
onload = undefined,
|
onload = undefined,
|
||||||
invitees,
|
invitees,
|
||||||
devices,
|
devices,
|
||||||
userInfo
|
userInfo,
|
||||||
|
e2eeKey
|
||||||
} = parseArguments(args);
|
} = parseArguments(args);
|
||||||
|
|
||||||
this._parentNode = parentNode;
|
this._parentNode = parentNode;
|
||||||
|
@ -276,6 +280,7 @@ export default class JitsiMeetExternalAPI extends EventEmitter {
|
||||||
if (Array.isArray(invitees) && invitees.length > 0) {
|
if (Array.isArray(invitees) && invitees.length > 0) {
|
||||||
this.invite(invitees);
|
this.invite(invitees);
|
||||||
}
|
}
|
||||||
|
this._tmpE2EEKey = e2eeKey;
|
||||||
this._isLargeVideoVisible = true;
|
this._isLargeVideoVisible = true;
|
||||||
this._numberOfParticipants = 0;
|
this._numberOfParticipants = 0;
|
||||||
this._participants = {};
|
this._participants = {};
|
||||||
|
@ -429,11 +434,17 @@ export default class JitsiMeetExternalAPI extends EventEmitter {
|
||||||
const userID = data.id;
|
const userID = data.id;
|
||||||
|
|
||||||
switch (name) {
|
switch (name) {
|
||||||
case 'video-conference-joined':
|
case 'video-conference-joined': {
|
||||||
|
if (typeof this._tmpE2EEKey !== 'undefined') {
|
||||||
|
this.executeCommand(commands.e2eeKey, this._tmpE2EEKey);
|
||||||
|
this._tmpE2EEKey = undefined;
|
||||||
|
}
|
||||||
|
|
||||||
this._myUserID = userID;
|
this._myUserID = userID;
|
||||||
this._participants[userID] = {
|
this._participants[userID] = {
|
||||||
avatarURL: data.avatarURL
|
avatarURL: data.avatarURL
|
||||||
};
|
};
|
||||||
|
}
|
||||||
|
|
||||||
// eslint-disable-next-line no-fallthrough
|
// eslint-disable-next-line no-fallthrough
|
||||||
case 'participant-joined': {
|
case 'participant-joined': {
|
||||||
|
|
Loading…
Reference in New Issue