|
|
@@ -71,43 +71,40 @@ ReducerRegistry.register('features/base/conference', (state = {}, action) => {
|
|
71
|
71
|
* @returns {Object} The new state of the feature base/conference after the
|
|
72
|
72
|
* reduction of the specified action.
|
|
73
|
73
|
*/
|
|
74
|
|
-function _conferenceFailed(state, action) {
|
|
75
|
|
- const conference = action.conference;
|
|
76
|
|
-
|
|
|
74
|
+function _conferenceFailed(state, { conference, error }) {
|
|
77
|
75
|
if (state.conference && state.conference !== conference) {
|
|
78
|
76
|
return state;
|
|
79
|
77
|
}
|
|
80
|
78
|
|
|
81
|
79
|
const passwordRequired
|
|
82
|
|
- = JitsiConferenceErrors.PASSWORD_REQUIRED === action.error
|
|
|
80
|
+ = JitsiConferenceErrors.PASSWORD_REQUIRED === error
|
|
83
|
81
|
? conference
|
|
84
|
82
|
: undefined;
|
|
85
|
83
|
|
|
86
|
|
- return (
|
|
87
|
|
- assign(state, {
|
|
88
|
|
- audioOnly: undefined,
|
|
89
|
|
- audioOnlyVideoMuted: undefined,
|
|
90
|
|
- conference: undefined,
|
|
91
|
|
- joining: undefined,
|
|
92
|
|
- leaving: undefined,
|
|
93
|
|
-
|
|
94
|
|
- /**
|
|
95
|
|
- * The indicator of how the conference/room is locked. If falsy, the
|
|
96
|
|
- * conference/room is unlocked; otherwise, it's either
|
|
97
|
|
- * {@code LOCKED_LOCALLY} or {@code LOCKED_REMOTELY}.
|
|
98
|
|
- *
|
|
99
|
|
- * @type {string}
|
|
100
|
|
- */
|
|
101
|
|
- locked: passwordRequired ? LOCKED_REMOTELY : undefined,
|
|
102
|
|
- password: undefined,
|
|
103
|
|
-
|
|
104
|
|
- /**
|
|
105
|
|
- * The JitsiConference instance which requires a password to join.
|
|
106
|
|
- *
|
|
107
|
|
- * @type {JitsiConference}
|
|
108
|
|
- */
|
|
109
|
|
- passwordRequired
|
|
110
|
|
- }));
|
|
|
84
|
+ return assign(state, {
|
|
|
85
|
+ audioOnly: undefined,
|
|
|
86
|
+ audioOnlyVideoMuted: undefined,
|
|
|
87
|
+ conference: undefined,
|
|
|
88
|
+ joining: undefined,
|
|
|
89
|
+ leaving: undefined,
|
|
|
90
|
+
|
|
|
91
|
+ /**
|
|
|
92
|
+ * The indicator of how the conference/room is locked. If falsy, the
|
|
|
93
|
+ * conference/room is unlocked; otherwise, it's either
|
|
|
94
|
+ * {@code LOCKED_LOCALLY} or {@code LOCKED_REMOTELY}.
|
|
|
95
|
+ *
|
|
|
96
|
+ * @type {string}
|
|
|
97
|
+ */
|
|
|
98
|
+ locked: passwordRequired ? LOCKED_REMOTELY : undefined,
|
|
|
99
|
+ password: undefined,
|
|
|
100
|
+
|
|
|
101
|
+ /**
|
|
|
102
|
+ * The JitsiConference instance which requires a password to join.
|
|
|
103
|
+ *
|
|
|
104
|
+ * @type {JitsiConference}
|
|
|
105
|
+ */
|
|
|
106
|
+ passwordRequired
|
|
|
107
|
+ });
|
|
111
|
108
|
}
|
|
112
|
109
|
|
|
113
|
110
|
/**
|
|
|
@@ -120,35 +117,32 @@ function _conferenceFailed(state, action) {
|
|
120
|
117
|
* @returns {Object} The new state of the feature base/conference after the
|
|
121
|
118
|
* reduction of the specified action.
|
|
122
|
119
|
*/
|
|
123
|
|
-function _conferenceJoined(state, action) {
|
|
124
|
|
- const conference = action.conference;
|
|
125
|
|
-
|
|
|
120
|
+function _conferenceJoined(state, { conference }) {
|
|
126
|
121
|
// FIXME The indicator which determines whether a JitsiConference is locked
|
|
127
|
122
|
// i.e. password-protected is private to lib-jitsi-meet. However, the
|
|
128
|
123
|
// library does not fire LOCK_STATE_CHANGED upon joining a JitsiConference
|
|
129
|
124
|
// with a password.
|
|
130
|
125
|
const locked = conference.room.locked ? LOCKED_REMOTELY : undefined;
|
|
131
|
126
|
|
|
132
|
|
- return (
|
|
133
|
|
- assign(state, {
|
|
134
|
|
- /**
|
|
135
|
|
- * The JitsiConference instance represented by the Redux state of
|
|
136
|
|
- * the feature base/conference.
|
|
137
|
|
- *
|
|
138
|
|
- * @type {JitsiConference}
|
|
139
|
|
- */
|
|
140
|
|
- conference,
|
|
141
|
|
- joining: undefined,
|
|
142
|
|
- leaving: undefined,
|
|
143
|
|
-
|
|
144
|
|
- /**
|
|
145
|
|
- * The indicator which determines whether the conference is locked.
|
|
146
|
|
- *
|
|
147
|
|
- * @type {boolean}
|
|
148
|
|
- */
|
|
149
|
|
- locked,
|
|
150
|
|
- passwordRequired: undefined
|
|
151
|
|
- }));
|
|
|
127
|
+ return assign(state, {
|
|
|
128
|
+ /**
|
|
|
129
|
+ * The JitsiConference instance represented by the Redux state of the
|
|
|
130
|
+ * feature base/conference.
|
|
|
131
|
+ *
|
|
|
132
|
+ * @type {JitsiConference}
|
|
|
133
|
+ */
|
|
|
134
|
+ conference,
|
|
|
135
|
+ joining: undefined,
|
|
|
136
|
+ leaving: undefined,
|
|
|
137
|
+
|
|
|
138
|
+ /**
|
|
|
139
|
+ * The indicator which determines whether the conference is locked.
|
|
|
140
|
+ *
|
|
|
141
|
+ * @type {boolean}
|
|
|
142
|
+ */
|
|
|
143
|
+ locked,
|
|
|
144
|
+ passwordRequired: undefined
|
|
|
145
|
+ });
|
|
152
|
146
|
}
|
|
153
|
147
|
|
|
154
|
148
|
/**
|
|
|
@@ -161,24 +155,21 @@ function _conferenceJoined(state, action) {
|
|
161
|
155
|
* @returns {Object} The new state of the feature base/conference after the
|
|
162
|
156
|
* reduction of the specified action.
|
|
163
|
157
|
*/
|
|
164
|
|
-function _conferenceLeft(state, action) {
|
|
165
|
|
- const conference = action.conference;
|
|
166
|
|
-
|
|
|
158
|
+function _conferenceLeft(state, { conference }) {
|
|
167
|
159
|
if (state.conference !== conference) {
|
|
168
|
160
|
return state;
|
|
169
|
161
|
}
|
|
170
|
162
|
|
|
171
|
|
- return (
|
|
172
|
|
- assign(state, {
|
|
173
|
|
- audioOnly: undefined,
|
|
174
|
|
- audioOnlyVideoMuted: undefined,
|
|
175
|
|
- conference: undefined,
|
|
176
|
|
- joining: undefined,
|
|
177
|
|
- leaving: undefined,
|
|
178
|
|
- locked: undefined,
|
|
179
|
|
- password: undefined,
|
|
180
|
|
- passwordRequired: undefined
|
|
181
|
|
- }));
|
|
|
163
|
+ return assign(state, {
|
|
|
164
|
+ audioOnly: undefined,
|
|
|
165
|
+ audioOnlyVideoMuted: undefined,
|
|
|
166
|
+ conference: undefined,
|
|
|
167
|
+ joining: undefined,
|
|
|
168
|
+ leaving: undefined,
|
|
|
169
|
+ locked: undefined,
|
|
|
170
|
+ password: undefined,
|
|
|
171
|
+ passwordRequired: undefined
|
|
|
172
|
+ });
|
|
182
|
173
|
}
|
|
183
|
174
|
|
|
184
|
175
|
/**
|
|
|
@@ -191,8 +182,8 @@ function _conferenceLeft(state, action) {
|
|
191
|
182
|
* @returns {Object} The new state of the feature base/conference after the
|
|
192
|
183
|
* reduction of the specified action.
|
|
193
|
184
|
*/
|
|
194
|
|
-function _conferenceWillJoin(state, action) {
|
|
195
|
|
- return set(state, 'joining', action.conference);
|
|
|
185
|
+function _conferenceWillJoin(state, { conference }) {
|
|
|
186
|
+ return set(state, 'joining', conference);
|
|
196
|
187
|
}
|
|
197
|
188
|
|
|
198
|
189
|
/**
|
|
|
@@ -205,24 +196,23 @@ function _conferenceWillJoin(state, action) {
|
|
205
|
196
|
* @returns {Object} The new state of the feature base/conference after the
|
|
206
|
197
|
* reduction of the specified action.
|
|
207
|
198
|
*/
|
|
208
|
|
-function _conferenceWillLeave(state, action) {
|
|
209
|
|
- const conference = action.conference;
|
|
210
|
|
-
|
|
|
199
|
+function _conferenceWillLeave(state, { conference }) {
|
|
211
|
200
|
if (state.conference !== conference) {
|
|
212
|
201
|
return state;
|
|
213
|
202
|
}
|
|
214
|
203
|
|
|
215
|
|
- return (
|
|
216
|
|
- assign(state, {
|
|
217
|
|
- /**
|
|
218
|
|
- * The JitsiConference instance which is currently in the process of
|
|
219
|
|
- * being left.
|
|
220
|
|
- *
|
|
221
|
|
- * @type {JitsiConference}
|
|
222
|
|
- */
|
|
223
|
|
- leaving: conference,
|
|
224
|
|
- passwordRequired: undefined
|
|
225
|
|
- }));
|
|
|
204
|
+ return assign(state, {
|
|
|
205
|
+ joining: undefined,
|
|
|
206
|
+
|
|
|
207
|
+ /**
|
|
|
208
|
+ * The JitsiConference instance which is currently in the process of
|
|
|
209
|
+ * being left.
|
|
|
210
|
+ *
|
|
|
211
|
+ * @type {JitsiConference}
|
|
|
212
|
+ */
|
|
|
213
|
+ leaving: conference,
|
|
|
214
|
+ passwordRequired: undefined
|
|
|
215
|
+ });
|
|
226
|
216
|
}
|
|
227
|
217
|
|
|
228
|
218
|
/**
|
|
|
@@ -235,20 +225,14 @@ function _conferenceWillLeave(state, action) {
|
|
235
|
225
|
* @returns {Object} The new state of the feature base/conference after the
|
|
236
|
226
|
* reduction of the specified action.
|
|
237
|
227
|
*/
|
|
238
|
|
-function _lockStateChanged(state, action) {
|
|
239
|
|
- if (state.conference !== action.conference) {
|
|
|
228
|
+function _lockStateChanged(state, { conference, locked }) {
|
|
|
229
|
+ if (state.conference !== conference) {
|
|
240
|
230
|
return state;
|
|
241
|
231
|
}
|
|
242
|
232
|
|
|
243
|
|
- let locked;
|
|
244
|
|
-
|
|
245
|
|
- if (action.locked) {
|
|
246
|
|
- locked = state.locked || LOCKED_REMOTELY;
|
|
247
|
|
- }
|
|
248
|
|
-
|
|
249
|
233
|
return assign(state, {
|
|
250
|
|
- locked,
|
|
251
|
|
- password: action.locked ? state.password : null
|
|
|
234
|
+ locked: locked ? state.locked || LOCKED_REMOTELY : undefined,
|
|
|
235
|
+ password: locked ? state.password : undefined
|
|
252
|
236
|
});
|
|
253
|
237
|
}
|
|
254
|
238
|
|
|
|
@@ -305,31 +289,28 @@ function _setLargeVideoHDStatus(state, action) {
|
|
305
|
289
|
* @returns {Object} The new state of the feature base/conference after the
|
|
306
|
290
|
* reduction of the specified action.
|
|
307
|
291
|
*/
|
|
308
|
|
-function _setPassword(state, action) {
|
|
309
|
|
- const conference = action.conference;
|
|
310
|
|
-
|
|
311
|
|
- switch (action.method) {
|
|
|
292
|
+function _setPassword(state, { conference, method, password }) {
|
|
|
293
|
+ switch (method) {
|
|
312
|
294
|
case conference.join:
|
|
313
|
295
|
if (state.passwordRequired === conference) {
|
|
314
|
|
- return (
|
|
315
|
|
- assign(state, {
|
|
316
|
|
- locked: LOCKED_REMOTELY,
|
|
317
|
|
-
|
|
318
|
|
- /**
|
|
319
|
|
- * The password with which the conference is to be joined.
|
|
320
|
|
- *
|
|
321
|
|
- * @type {string}
|
|
322
|
|
- */
|
|
323
|
|
- password: action.password,
|
|
324
|
|
- passwordRequired: undefined
|
|
325
|
|
- }));
|
|
|
296
|
+ return assign(state, {
|
|
|
297
|
+ locked: LOCKED_REMOTELY,
|
|
|
298
|
+
|
|
|
299
|
+ /**
|
|
|
300
|
+ * The password with which the conference is to be joined.
|
|
|
301
|
+ *
|
|
|
302
|
+ * @type {string}
|
|
|
303
|
+ */
|
|
|
304
|
+ password,
|
|
|
305
|
+ passwordRequired: undefined
|
|
|
306
|
+ });
|
|
326
|
307
|
}
|
|
327
|
308
|
break;
|
|
328
|
309
|
|
|
329
|
310
|
case conference.lock:
|
|
330
|
311
|
return assign(state, {
|
|
331
|
|
- locked: action.password ? LOCKED_LOCALLY : undefined,
|
|
332
|
|
- password: action.password
|
|
|
312
|
+ locked: password ? LOCKED_LOCALLY : undefined,
|
|
|
313
|
+ password
|
|
333
|
314
|
});
|
|
334
|
315
|
}
|
|
335
|
316
|
|