fix(vpaas): Don't show recording link to initiator if saving on dropbox

This commit is contained in:
Vlad Piersec 2021-06-23 11:57:11 +03:00 committed by vp8x8
parent 2a9b3dc1b2
commit 3e8f725c62
5 changed files with 53 additions and 4 deletions

View File

@ -37,6 +37,16 @@ export const RECORDING_SESSION_UPDATED = 'RECORDING_SESSION_UPDATED';
export const SET_PENDING_RECORDING_NOTIFICATION_UID
= 'SET_PENDING_RECORDING_NOTIFICATION_UID';
/**
* The type of Redux action which sets the selected recording service.
*
* {
* type: SET_SELECTED_RECORDING_SERVICE
* }
* @public
*/
export const SET_SELECTED_RECORDING_SERVICE = 'SET_SELECTED_RECORDING_SERVICE';
/**
* Sets the stream key last used by the user for later reuse.
*

View File

@ -16,9 +16,10 @@ import {
CLEAR_RECORDING_SESSIONS,
RECORDING_SESSION_UPDATED,
SET_PENDING_RECORDING_NOTIFICATION_UID,
SET_SELECTED_RECORDING_SERVICE,
SET_STREAM_KEY
} from './actionTypes';
import { getRecordingLink, getResourceId } from './functions';
import { getRecordingLink, getResourceId, isSavingRecordingOnDropbox } from './functions';
import logger from './logger';
/**
@ -179,7 +180,8 @@ export function showStartedRecordingNotification(
// fetch the recording link from the server for recording initiators in jaas meetings
if (recordingSharingUrl
&& isVpaasMeeting(state)
&& iAmRecordingInitiator) {
&& iAmRecordingInitiator
&& !isSavingRecordingOnDropbox(state)) {
const region = getMeetingRegion(state);
const tenant = getVpaasTenant(state);
@ -238,6 +240,19 @@ export function updateRecordingSessionData(session: Object) {
};
}
/**
* Sets the selected recording service.
*
* @param {string} selectedRecordingService - The new selected recording service.
* @returns {Object}
*/
export function setSelectedRecordingService(selectedRecordingService: string) {
return {
type: SET_SELECTED_RECORDING_SERVICE,
selectedRecordingService
};
}
/**
* Sets UID of the the pending streaming notification to use it when hinding
* the notification is necessary, or unsets it when undefined (or no param) is

View File

@ -12,6 +12,7 @@ import {
isEnabled as isDropboxEnabled
} from '../../../dropbox';
import { toggleRequestingSubtitles } from '../../../subtitles';
import { setSelectedRecordingService } from '../../actions';
import { RECORDING_TYPES } from '../../constants';
type Props = {
@ -196,7 +197,9 @@ class AbstractStartRecordingDialog extends Component<Props, State> {
* @returns {void}
*/
_onSelectedRecordingServiceChanged(selectedRecordingService) {
this.setState({ selectedRecordingService });
this.setState({ selectedRecordingService }, () => {
this.props.dispatch(setSelectedRecordingService(selectedRecordingService));
});
}
/**

View File

@ -1,8 +1,9 @@
// @flow
import { JitsiRecordingConstants } from '../base/lib-jitsi-meet';
import { isEnabled as isDropboxEnabled } from '../dropbox';
import { RECORDING_STATUS_PRIORITIES } from './constants';
import { RECORDING_STATUS_PRIORITIES, RECORDING_TYPES } from './constants';
/**
* Searches in the passed in redux state for an active recording session of the
@ -67,6 +68,17 @@ export async function getRecordingLink(url: string, recordingSessionId: string,
return res.ok ? json.url : Promise.reject(json);
}
/**
* Selector used for determining if recording is saved on dropbox.
*
* @param {Object} state - The redux state to search in.
* @returns {string}
*/
export function isSavingRecordingOnDropbox(state: Object) {
return isDropboxEnabled(state)
&& state['features/recording'].selectedRecordingService === RECORDING_TYPES.DROPBOX;
}
/**
* Returns the recording session status that is to be shown in a label. E.g. If
* there is a session with the status OFF and one with PENDING, then the PENDING

View File

@ -4,11 +4,13 @@ import {
CLEAR_RECORDING_SESSIONS,
RECORDING_SESSION_UPDATED,
SET_PENDING_RECORDING_NOTIFICATION_UID,
SET_SELECTED_RECORDING_SERVICE,
SET_STREAM_KEY
} from './actionTypes';
const DEFAULT_STATE = {
pendingNotificationUids: {},
selectedRecordingService: '',
sessionDatas: []
};
@ -50,6 +52,13 @@ ReducerRegistry.register(STORE_NAME,
};
}
case SET_SELECTED_RECORDING_SERVICE: {
return {
...state,
selectedRecordingService: action.selectedRecordingService
};
}
case SET_STREAM_KEY:
return {
...state,