|
@@ -17,15 +17,16 @@ import {
|
17
|
17
|
getCurrentConference,
|
18
|
18
|
isRoomValid
|
19
|
19
|
} from '../../base/conference';
|
20
|
|
-import { LOAD_CONFIG_ERROR } from '../../base/config';
|
21
|
20
|
import {
|
22
|
21
|
CONNECTION_DISCONNECTED,
|
23
|
|
- CONNECTION_FAILED,
|
24
|
22
|
JITSI_CONNECTION_CONFERENCE_KEY,
|
25
|
23
|
JITSI_CONNECTION_URL_KEY,
|
26
|
24
|
getURLWithoutParams
|
27
|
25
|
} from '../../base/connection';
|
28
|
|
-import { JitsiConferenceEvents } from '../../base/lib-jitsi-meet';
|
|
26
|
+import {
|
|
27
|
+ isFatalJitsiConferenceError,
|
|
28
|
+ isFatalJitsiConnectionError,
|
|
29
|
+ JitsiConferenceEvents } from '../../base/lib-jitsi-meet';
|
29
|
30
|
import { MEDIA_TYPE } from '../../base/media';
|
30
|
31
|
import { SET_AUDIO_MUTED, SET_VIDEO_MUTED } from '../../base/media/actionTypes';
|
31
|
32
|
import {
|
|
@@ -40,6 +41,7 @@ import { toggleScreensharing } from '../../base/tracks';
|
40
|
41
|
import { OPEN_CHAT, CLOSE_CHAT } from '../../chat';
|
41
|
42
|
import { openChat } from '../../chat/actions';
|
42
|
43
|
import { sendMessage, setPrivateMessageRecipient, closeChat } from '../../chat/actions.any';
|
|
44
|
+import { SET_PAGE_RELOAD_OVERLAY_CANCELED } from '../../overlay/actionTypes';
|
43
|
45
|
import { muteLocal } from '../../video-menu/actions';
|
44
|
46
|
import { ENTER_PICTURE_IN_PICTURE } from '../picture-in-picture';
|
45
|
47
|
|
|
@@ -114,7 +116,7 @@ MiddlewareRegistry.register(store => next => action => {
|
114
|
116
|
// counterpart of the External API (or at least not in the
|
115
|
117
|
// fatality/finality semantics attributed to
|
116
|
118
|
// conferenceFailed:/onConferenceFailed).
|
117
|
|
- if (!error.recoverable) {
|
|
119
|
+ if (!error.recoverable && !isFatalJitsiConnectionError(error) && !isFatalJitsiConferenceError(error)) {
|
118
|
120
|
_sendConferenceEvent(store, /* action */ {
|
119
|
121
|
error: _toErrorString(error),
|
120
|
122
|
...data
|
|
@@ -154,28 +156,10 @@ MiddlewareRegistry.register(store => next => action => {
|
154
|
156
|
break;
|
155
|
157
|
}
|
156
|
158
|
|
157
|
|
- case CONNECTION_FAILED:
|
158
|
|
- !action.error.recoverable
|
159
|
|
- && _sendConferenceFailedOnConnectionError(store, action);
|
160
|
|
- break;
|
161
|
|
-
|
162
|
159
|
case ENTER_PICTURE_IN_PICTURE:
|
163
|
160
|
sendEvent(store, type, /* data */ {});
|
164
|
161
|
break;
|
165
|
162
|
|
166
|
|
- case LOAD_CONFIG_ERROR: {
|
167
|
|
- const { error, locationURL } = action;
|
168
|
|
-
|
169
|
|
- sendEvent(
|
170
|
|
- store,
|
171
|
|
- CONFERENCE_TERMINATED,
|
172
|
|
- /* data */ {
|
173
|
|
- error: _toErrorString(error),
|
174
|
|
- url: _normalizeUrl(locationURL)
|
175
|
|
- });
|
176
|
|
- break;
|
177
|
|
- }
|
178
|
|
-
|
179
|
163
|
case OPEN_CHAT:
|
180
|
164
|
case CLOSE_CHAT: {
|
181
|
165
|
sendEvent(
|
|
@@ -219,6 +203,16 @@ MiddlewareRegistry.register(store => next => action => {
|
219
|
203
|
});
|
220
|
204
|
break;
|
221
|
205
|
|
|
206
|
+ case SET_PAGE_RELOAD_OVERLAY_CANCELED:
|
|
207
|
+ sendEvent(
|
|
208
|
+ store,
|
|
209
|
+ CONFERENCE_TERMINATED,
|
|
210
|
+ /* data */ {
|
|
211
|
+ error: _toErrorString(action.error),
|
|
212
|
+ url: _normalizeUrl(store.getState()['features/base/connection'].locationURL)
|
|
213
|
+ });
|
|
214
|
+
|
|
215
|
+ break;
|
222
|
216
|
case SET_VIDEO_MUTED:
|
223
|
217
|
sendEvent(
|
224
|
218
|
store,
|
|
@@ -551,36 +545,6 @@ function _sendConferenceEvent(
|
551
|
545
|
sendEvent(store, type_, data);
|
552
|
546
|
}
|
553
|
547
|
|
554
|
|
-/**
|
555
|
|
- * Sends {@link CONFERENCE_TERMINATED} event when the {@link CONNECTION_FAILED}
|
556
|
|
- * occurs. It should be done only if the connection fails before the conference
|
557
|
|
- * instance is created. Otherwise the eventual failure event is supposed to be
|
558
|
|
- * emitted by the base/conference feature.
|
559
|
|
- *
|
560
|
|
- * @param {Store} store - The redux store.
|
561
|
|
- * @param {Action} action - The redux action.
|
562
|
|
- * @returns {void}
|
563
|
|
- */
|
564
|
|
-function _sendConferenceFailedOnConnectionError(store, action) {
|
565
|
|
- const { locationURL } = store.getState()['features/base/connection'];
|
566
|
|
- const { connection } = action;
|
567
|
|
-
|
568
|
|
- locationURL
|
569
|
|
- && forEachConference(
|
570
|
|
- store,
|
571
|
|
-
|
572
|
|
- // If there's any conference in the base/conference state then the
|
573
|
|
- // base/conference feature is supposed to emit a failure.
|
574
|
|
- conference => conference.getConnection() !== connection)
|
575
|
|
- && sendEvent(
|
576
|
|
- store,
|
577
|
|
- CONFERENCE_TERMINATED,
|
578
|
|
- /* data */ {
|
579
|
|
- url: _normalizeUrl(locationURL),
|
580
|
|
- error: action.error.name
|
581
|
|
- });
|
582
|
|
-}
|
583
|
|
-
|
584
|
548
|
/**
|
585
|
549
|
* Determines whether to not send a {@code CONFERENCE_LEFT} event to the native
|
586
|
550
|
* counterpart of the External API.
|