|
|
@@ -235,14 +235,40 @@ export function participantDisplayNameChanged(id, displayName = '') {
|
|
235
|
235
|
* }}
|
|
236
|
236
|
*/
|
|
237
|
237
|
export function participantJoined(participant) {
|
|
238
|
|
- if (!participant.local && !participant.conference) {
|
|
|
238
|
+ // Only the local participant is not identified with an id-conference pair.
|
|
|
239
|
+ if (participant.local) {
|
|
|
240
|
+ return {
|
|
|
241
|
+ type: PARTICIPANT_JOINED,
|
|
|
242
|
+ participant
|
|
|
243
|
+ };
|
|
|
244
|
+ }
|
|
|
245
|
+
|
|
|
246
|
+ // In other words, a remote participant is identified with an id-conference
|
|
|
247
|
+ // pair.
|
|
|
248
|
+ const { conference } = participant;
|
|
|
249
|
+
|
|
|
250
|
+ if (!conference) {
|
|
239
|
251
|
throw Error(
|
|
240
|
252
|
'A remote participant must be associated with a JitsiConference!');
|
|
241
|
253
|
}
|
|
242
|
254
|
|
|
243
|
|
- return {
|
|
244
|
|
- type: PARTICIPANT_JOINED,
|
|
245
|
|
- participant
|
|
|
255
|
+ return (dispatch, getState) => {
|
|
|
256
|
+ // A remote participant is only expected to join in a joined or joining
|
|
|
257
|
+ // conference. The following check is really necessary because a
|
|
|
258
|
+ // JitsiConference may have moved into leaving but may still manage to
|
|
|
259
|
+ // sneak a PARTICIPANT_JOINED in if its leave is delayed for any purpose
|
|
|
260
|
+ // (which is not outragous given that leaving involves network
|
|
|
261
|
+ // requests.)
|
|
|
262
|
+ const stateFeaturesBaseConference
|
|
|
263
|
+ = getState()['features/base/conference'];
|
|
|
264
|
+
|
|
|
265
|
+ if (conference === stateFeaturesBaseConference.conference
|
|
|
266
|
+ || conference === stateFeaturesBaseConference.joining) {
|
|
|
267
|
+ return dispatch({
|
|
|
268
|
+ type: PARTICIPANT_JOINED,
|
|
|
269
|
+ participant
|
|
|
270
|
+ });
|
|
|
271
|
+ }
|
|
246
|
272
|
};
|
|
247
|
273
|
}
|
|
248
|
274
|
|