feat(external-api): add local subject command (#10636)
* feat(external-api): add local subject command * add to whitelist * apply config value
This commit is contained in:
parent
09613167a6
commit
39e0dc84e0
|
@ -1054,6 +1054,9 @@ var config = {
|
|||
// Sets the conference subject
|
||||
// subject: 'Conference Subject',
|
||||
|
||||
// Sets the conference local subject
|
||||
// localSubject: 'Conference Local Subject',
|
||||
|
||||
// This property is related to the use case when jitsi-meet is used via the IFrame API. When the property is true
|
||||
// jitsi-meet will use the local storage of the host page instead of its own. This option is useful if the browser
|
||||
// is not persisting the local storage inside the iframe.
|
||||
|
|
|
@ -21,6 +21,7 @@ import {
|
|||
getCurrentConference,
|
||||
sendTones,
|
||||
setFollowMe,
|
||||
setLocalSubject,
|
||||
setPassword,
|
||||
setSubject
|
||||
} from '../../react/features/base/conference';
|
||||
|
@ -136,6 +137,10 @@ function initCommands() {
|
|||
sendAnalytics(createApiEvent('display.name.changed'));
|
||||
APP.conference.changeLocalDisplayName(displayName);
|
||||
},
|
||||
'local-subject': localSubject => {
|
||||
sendAnalytics(createApiEvent('local.subject.changed'));
|
||||
APP.store.dispatch(setLocalSubject(localSubject));
|
||||
},
|
||||
'mute-everyone': mediaType => {
|
||||
const muteMediaType = mediaType ? mediaType : MEDIA_TYPE.AUDIO;
|
||||
|
||||
|
|
|
@ -38,6 +38,7 @@ const commands = {
|
|||
toggleLobby: 'toggle-lobby',
|
||||
hangup: 'video-hangup',
|
||||
initiatePrivateChat: 'initiate-private-chat',
|
||||
localSubject: 'local-subject',
|
||||
kickParticipant: 'kick-participant',
|
||||
muteEveryone: 'mute-everyone',
|
||||
overwriteConfig: 'overwrite-config',
|
||||
|
|
|
@ -43,6 +43,16 @@ export const CONFERENCE_JOINED = 'CONFERENCE_JOINED';
|
|||
export const CONFERENCE_LEFT = 'CONFERENCE_LEFT';
|
||||
|
||||
/**
|
||||
* The type of (redux) action, which indicates conference local subject changes.
|
||||
*
|
||||
* {
|
||||
* type: CONFERENCE_LOCAL_SUBJECT_CHANGED
|
||||
* subject: string
|
||||
* }
|
||||
*/
|
||||
export const CONFERENCE_LOCAL_SUBJECT_CHANGED = 'CONFERENCE_LOCAL_SUBJECT_CHANGED';
|
||||
|
||||
/**
|
||||
* The type of (redux) action, which indicates conference subject changes.
|
||||
*
|
||||
* {
|
||||
|
|
|
@ -41,6 +41,7 @@ import {
|
|||
CONFERENCE_FAILED,
|
||||
CONFERENCE_JOINED,
|
||||
CONFERENCE_LEFT,
|
||||
CONFERENCE_LOCAL_SUBJECT_CHANGED,
|
||||
CONFERENCE_SUBJECT_CHANGED,
|
||||
CONFERENCE_TIMESTAMP_CHANGED,
|
||||
CONFERENCE_UNIQUE_ID_SET,
|
||||
|
@ -792,7 +793,7 @@ export function setStartMutedPolicy(
|
|||
}
|
||||
|
||||
/**
|
||||
* Changing conference subject.
|
||||
* Sets the conference subject.
|
||||
*
|
||||
* @param {string} subject - The new subject.
|
||||
* @returns {void}
|
||||
|
@ -811,3 +812,19 @@ export function setSubject(subject: string) {
|
|||
}
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the conference local subject.
|
||||
*
|
||||
* @param {string} localSubject - The new local subject.
|
||||
* @returns {{
|
||||
* type: CONFERENCE_LOCAL_SUBJECT_CHANGED,
|
||||
* localSubject: string
|
||||
* }}
|
||||
*/
|
||||
export function setLocalSubject(localSubject: string) {
|
||||
return {
|
||||
type: CONFERENCE_LOCAL_SUBJECT_CHANGED,
|
||||
localSubject
|
||||
};
|
||||
}
|
||||
|
|
|
@ -180,9 +180,9 @@ export function getConferenceName(stateful: Function | Object): string {
|
|||
const state = toState(stateful);
|
||||
const { callee } = state['features/base/jwt'];
|
||||
const { callDisplayName } = state['features/base/config'];
|
||||
const { pendingSubjectChange, room, subject } = getConferenceState(state);
|
||||
const { localSubject, room, subject } = getConferenceState(state);
|
||||
|
||||
return pendingSubjectChange
|
||||
return localSubject
|
||||
|| subject
|
||||
|| callDisplayName
|
||||
|| (callee && callee.name)
|
||||
|
|
|
@ -39,6 +39,7 @@ import {
|
|||
conferenceFailed,
|
||||
conferenceWillLeave,
|
||||
createConference,
|
||||
setLocalSubject,
|
||||
setSubject
|
||||
} from './actions';
|
||||
import { TRIGGER_READY_TO_CLOSE_REASONS } from './constants';
|
||||
|
@ -484,11 +485,12 @@ function _sendTones({ getState }, next, action) {
|
|||
*/
|
||||
function _setRoom({ dispatch, getState }, next, action) {
|
||||
const state = getState();
|
||||
const { subject } = state['features/base/config'];
|
||||
const { localSubject, subject } = state['features/base/config'];
|
||||
const { room } = action;
|
||||
|
||||
if (room) {
|
||||
// Set the stored subject.
|
||||
dispatch(setLocalSubject(localSubject));
|
||||
dispatch(setSubject(subject));
|
||||
}
|
||||
|
||||
|
|
|
@ -10,6 +10,7 @@ import {
|
|||
CONFERENCE_FAILED,
|
||||
CONFERENCE_JOINED,
|
||||
CONFERENCE_LEFT,
|
||||
CONFERENCE_LOCAL_SUBJECT_CHANGED,
|
||||
CONFERENCE_SUBJECT_CHANGED,
|
||||
CONFERENCE_TIMESTAMP_CHANGED,
|
||||
CONFERENCE_WILL_JOIN,
|
||||
|
@ -56,6 +57,9 @@ ReducerRegistry.register(
|
|||
case CONFERENCE_SUBJECT_CHANGED:
|
||||
return set(state, 'subject', action.subject);
|
||||
|
||||
case CONFERENCE_LOCAL_SUBJECT_CHANGED:
|
||||
return set(state, 'localSubject', action.localSubject);
|
||||
|
||||
case CONFERENCE_TIMESTAMP_CHANGED:
|
||||
return set(state, 'conferenceTimestamp', action.conferenceTimestamp);
|
||||
|
||||
|
|
|
@ -177,6 +177,7 @@ export default [
|
|||
'inviteAppName',
|
||||
'liveStreamingEnabled',
|
||||
'localRecording',
|
||||
'localSubject',
|
||||
'maxFullResolutionParticipants',
|
||||
'mouseMoveCallbackInterval',
|
||||
'notifications',
|
||||
|
|
Loading…
Reference in New Issue