|
@@ -7,9 +7,11 @@ import {
|
7
|
7
|
CONFERENCE_JOINED,
|
8
|
8
|
CONFERENCE_LEFT,
|
9
|
9
|
CONFERENCE_WILL_JOIN,
|
10
|
|
- CONFERENCE_WILL_LEAVE
|
|
10
|
+ CONFERENCE_WILL_LEAVE,
|
|
11
|
+ JITSI_CONFERENCE_URL_KEY
|
11
|
12
|
} from '../../base/conference';
|
12
|
13
|
import { MiddlewareRegistry } from '../../base/redux';
|
|
14
|
+import { toURLString } from '../../base/util';
|
13
|
15
|
|
14
|
16
|
/**
|
15
|
17
|
* Middleware that captures Redux actions and uses the ExternalAPI module to
|
|
@@ -27,30 +29,13 @@ MiddlewareRegistry.register(store => next => action => {
|
27
|
29
|
case CONFERENCE_LEFT:
|
28
|
30
|
case CONFERENCE_WILL_JOIN:
|
29
|
31
|
case CONFERENCE_WILL_LEAVE: {
|
30
|
|
- const { conference, room, type, ...data } = action;
|
|
32
|
+ const { conference, type, ...data } = action;
|
31
|
33
|
|
32
|
|
- // For the above (redux) actions, conference and/or room identify a
|
|
34
|
+ // For the above (redux) actions, conference identifies a
|
33
|
35
|
// JitsiConference instance. The external API cannot transport such an
|
34
|
36
|
// object so we have to transport an "equivalent".
|
35
|
|
- if (conference || room) {
|
36
|
|
- // We have chosen to identify the object in question by the
|
37
|
|
- // (supposedly) associated location URL. (FIXME Actually, the redux
|
38
|
|
- // state locationURL is not really asssociated with the
|
39
|
|
- // JitsiConference instance. The value of localtionURL is utilized
|
40
|
|
- // in order to initialize the JitsiConference instance but the value
|
41
|
|
- // of locationURL at the time of CONFERENCE_WILL_LEAVE and
|
42
|
|
- // CONFERENCE_LEFT will not be the value with which the
|
43
|
|
- // JitsiConference instance being left.)
|
44
|
|
- const state = store.getState();
|
45
|
|
- const { locationURL } = state['features/base/connection'];
|
46
|
|
-
|
47
|
|
- if (!locationURL) {
|
48
|
|
- // The (redux) action cannot be fully converted to an (external
|
49
|
|
- // API) event.
|
50
|
|
- break;
|
51
|
|
- }
|
52
|
|
-
|
53
|
|
- data.url = locationURL.href;
|
|
37
|
+ if (conference) {
|
|
38
|
+ data.url = toURLString(conference[JITSI_CONFERENCE_URL_KEY]);
|
54
|
39
|
}
|
55
|
40
|
|
56
|
41
|
// The (externa API) event's name is the string representation of the
|