|
@@ -84,8 +84,13 @@ ReducerRegistry.register('features/base/participants', (state = [], action) => {
|
84
|
84
|
return state.filter(p =>
|
85
|
85
|
!(
|
86
|
86
|
p.id === id
|
87
|
|
- && (p.local
|
88
|
|
- || (conference && p.conference === conference))));
|
|
87
|
+
|
|
88
|
+ // XXX Do not allow collisions in the IDs of the local
|
|
89
|
+ // participant and a remote participant cause the removal of
|
|
90
|
+ // the local participant when the remote participant's
|
|
91
|
+ // removal is requested.
|
|
92
|
+ && p.conference === conference
|
|
93
|
+ && (conference || p.local)));
|
89
|
94
|
}
|
90
|
95
|
}
|
91
|
96
|
|
|
@@ -111,14 +116,21 @@ function _participant(state: Object = {}, action) {
|
111
|
116
|
return (
|
112
|
117
|
set(state, 'dominantSpeaker', state.id === action.participant.id));
|
113
|
118
|
|
114
|
|
- case PARTICIPANT_ID_CHANGED:
|
115
|
|
- if (state.id === action.oldValue) {
|
|
119
|
+ case PARTICIPANT_ID_CHANGED: {
|
|
120
|
+ // A participant is identified by an id-conference pair. Only the local
|
|
121
|
+ // participant is with an undefined conference.
|
|
122
|
+ const { conference } = action;
|
|
123
|
+
|
|
124
|
+ if (state.id === action.oldValue
|
|
125
|
+ && state.conference === conference
|
|
126
|
+ && (conference || state.local)) {
|
116
|
127
|
return {
|
117
|
128
|
...state,
|
118
|
129
|
id: action.newValue
|
119
|
130
|
};
|
120
|
131
|
}
|
121
|
132
|
break;
|
|
133
|
+ }
|
122
|
134
|
|
123
|
135
|
case PARTICIPANT_UPDATED: {
|
124
|
136
|
const { participant } = action; // eslint-disable-line no-shadow
|