Bläddra i källkod

config: add ability to pass the subject as a URL parameter

j8
Saúl Ibarra Corretgé 6 år sedan
förälder
incheckning
579d291bca

+ 32
- 1
react/features/base/conference/middleware.js Visa fil

@@ -37,7 +37,8 @@ import {
37 37
     DATA_CHANNEL_OPENED,
38 38
     SET_AUDIO_ONLY,
39 39
     SET_LASTN,
40
-    SET_PENDING_SUBJECT_CHANGE
40
+    SET_PENDING_SUBJECT_CHANGE,
41
+    SET_ROOM
41 42
 } from './actionTypes';
42 43
 import {
43 44
     _addLocalTracksToConference,
@@ -98,6 +99,9 @@ MiddlewareRegistry.register(store => next => action => {
98 99
     case SET_LASTN:
99 100
         return _setLastN(store, next, action);
100 101
 
102
+    case SET_ROOM:
103
+        return _setRoom(store, next, action);
104
+
101 105
     case TRACK_ADDED:
102 106
     case TRACK_REMOVED:
103 107
         return _trackAddedOrRemoved(store, next, action);
@@ -569,6 +573,33 @@ function _setReceiverVideoConstraint(conference, preferred, max) {
569 573
     }
570 574
 }
571 575
 
576
+/**
577
+ * Notifies the feature base/conference that the action
578
+ * {@code SET_ROOM} is being dispatched within a specific
579
+ *  redux store.
580
+ *
581
+ * @param {Store} store - The redux store in which the specified {@code action}
582
+ * is being dispatched.
583
+ * @param {Dispatch} next - The redux {@code dispatch} function to dispatch the
584
+ * specified {@code action} to the specified {@code store}.
585
+ * @param {Action} action - The redux action {@code SET_ROOM}
586
+ * which is being dispatched in the specified {@code store}.
587
+ * @private
588
+ * @returns {Object} The value returned by {@code next(action)}.
589
+ */
590
+function _setRoom({ dispatch, getState }, next, action) {
591
+    const state = getState();
592
+    const { subject } = state['features/base/config'];
593
+    const { room } = action;
594
+
595
+    if (room) {
596
+        // Set the stored subject.
597
+        dispatch(setSubject(subject));
598
+    }
599
+
600
+    return next(action);
601
+}
602
+
572 603
 /**
573 604
  * Synchronizes local tracks from state with local tracks in JitsiConference
574 605
  * instance.

+ 1
- 0
react/features/base/config/functions.any.js Visa fil

@@ -136,6 +136,7 @@ const WHITELISTED_KEYS = [
136 136
     'startVideoMuted',
137 137
     'startWithAudioMuted',
138 138
     'startWithVideoMuted',
139
+    'subject',
139 140
     'testing',
140 141
     'useIPv6',
141 142
     'useNicks',

Laddar…
Avbryt
Spara