Sfoglia il codice sorgente

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

master
Vlad Piersec 4 anni fa
parent
commit
3e8f725c62

+ 10
- 0
react/features/recording/actionTypes.js Vedi File

@@ -37,6 +37,16 @@ export const RECORDING_SESSION_UPDATED = 'RECORDING_SESSION_UPDATED';
37 37
 export const SET_PENDING_RECORDING_NOTIFICATION_UID
38 38
     = 'SET_PENDING_RECORDING_NOTIFICATION_UID';
39 39
 
40
+/**
41
+ * The type of Redux action which sets the selected recording service.
42
+ *
43
+ * {
44
+ *     type: SET_SELECTED_RECORDING_SERVICE
45
+ * }
46
+ * @public
47
+ */
48
+export const SET_SELECTED_RECORDING_SERVICE = 'SET_SELECTED_RECORDING_SERVICE';
49
+
40 50
 /**
41 51
  * Sets the stream key last used by the user for later reuse.
42 52
  *

+ 17
- 2
react/features/recording/actions.any.js Vedi File

@@ -16,9 +16,10 @@ import {
16 16
     CLEAR_RECORDING_SESSIONS,
17 17
     RECORDING_SESSION_UPDATED,
18 18
     SET_PENDING_RECORDING_NOTIFICATION_UID,
19
+    SET_SELECTED_RECORDING_SERVICE,
19 20
     SET_STREAM_KEY
20 21
 } from './actionTypes';
21
-import { getRecordingLink, getResourceId } from './functions';
22
+import { getRecordingLink, getResourceId, isSavingRecordingOnDropbox } from './functions';
22 23
 import logger from './logger';
23 24
 
24 25
 /**
@@ -179,7 +180,8 @@ export function showStartedRecordingNotification(
179 180
             // fetch the recording link from the server for recording initiators in jaas meetings
180 181
             if (recordingSharingUrl
181 182
                 && isVpaasMeeting(state)
182
-                && iAmRecordingInitiator) {
183
+                && iAmRecordingInitiator
184
+                && !isSavingRecordingOnDropbox(state)) {
183 185
                 const region = getMeetingRegion(state);
184 186
                 const tenant = getVpaasTenant(state);
185 187
 
@@ -238,6 +240,19 @@ export function updateRecordingSessionData(session: Object) {
238 240
     };
239 241
 }
240 242
 
243
+/**
244
+ * Sets the selected recording service.
245
+ *
246
+ * @param {string} selectedRecordingService - The new selected recording service.
247
+ * @returns {Object}
248
+ */
249
+export function setSelectedRecordingService(selectedRecordingService: string) {
250
+    return {
251
+        type: SET_SELECTED_RECORDING_SERVICE,
252
+        selectedRecordingService
253
+    };
254
+}
255
+
241 256
 /**
242 257
  * Sets UID of the the pending streaming notification to use it when hinding
243 258
  * the notification is necessary, or unsets it when undefined (or no param) is

+ 4
- 1
react/features/recording/components/Recording/AbstractStartRecordingDialog.js Vedi File

@@ -12,6 +12,7 @@ import {
12 12
     isEnabled as isDropboxEnabled
13 13
 } from '../../../dropbox';
14 14
 import { toggleRequestingSubtitles } from '../../../subtitles';
15
+import { setSelectedRecordingService } from '../../actions';
15 16
 import { RECORDING_TYPES } from '../../constants';
16 17
 
17 18
 type Props = {
@@ -196,7 +197,9 @@ class AbstractStartRecordingDialog extends Component<Props, State> {
196 197
      * @returns {void}
197 198
      */
198 199
     _onSelectedRecordingServiceChanged(selectedRecordingService) {
199
-        this.setState({ selectedRecordingService });
200
+        this.setState({ selectedRecordingService }, () => {
201
+            this.props.dispatch(setSelectedRecordingService(selectedRecordingService));
202
+        });
200 203
     }
201 204
 
202 205
     /**

+ 13
- 1
react/features/recording/functions.js Vedi File

@@ -1,8 +1,9 @@
1 1
 // @flow
2 2
 
3 3
 import { JitsiRecordingConstants } from '../base/lib-jitsi-meet';
4
+import { isEnabled as isDropboxEnabled } from '../dropbox';
4 5
 
5
-import { RECORDING_STATUS_PRIORITIES } from './constants';
6
+import { RECORDING_STATUS_PRIORITIES, RECORDING_TYPES } from './constants';
6 7
 
7 8
 /**
8 9
  * 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,
67 68
     return res.ok ? json.url : Promise.reject(json);
68 69
 }
69 70
 
71
+/**
72
+ * Selector used for determining if recording is saved on dropbox.
73
+ *
74
+ * @param {Object} state - The redux state to search in.
75
+ * @returns {string}
76
+ */
77
+export function isSavingRecordingOnDropbox(state: Object) {
78
+    return isDropboxEnabled(state)
79
+        && state['features/recording'].selectedRecordingService === RECORDING_TYPES.DROPBOX;
80
+}
81
+
70 82
 /**
71 83
  * Returns the recording session status that is to be shown in a label. E.g. If
72 84
  * there is a session with the status OFF and one with PENDING, then the PENDING

+ 9
- 0
react/features/recording/reducer.js Vedi File

@@ -4,11 +4,13 @@ import {
4 4
     CLEAR_RECORDING_SESSIONS,
5 5
     RECORDING_SESSION_UPDATED,
6 6
     SET_PENDING_RECORDING_NOTIFICATION_UID,
7
+    SET_SELECTED_RECORDING_SERVICE,
7 8
     SET_STREAM_KEY
8 9
 } from './actionTypes';
9 10
 
10 11
 const DEFAULT_STATE = {
11 12
     pendingNotificationUids: {},
13
+    selectedRecordingService: '',
12 14
     sessionDatas: []
13 15
 };
14 16
 
@@ -50,6 +52,13 @@ ReducerRegistry.register(STORE_NAME,
50 52
             };
51 53
         }
52 54
 
55
+        case SET_SELECTED_RECORDING_SERVICE: {
56
+            return {
57
+                ...state,
58
+                selectedRecordingService: action.selectedRecordingService
59
+            };
60
+        }
61
+
53 62
         case SET_STREAM_KEY:
54 63
             return {
55 64
                 ...state,

Loading…
Annulla
Salva