|
@@ -1,20 +1,28 @@
|
1
|
1
|
// @flow
|
2
|
2
|
|
3
|
|
-import { CONFERENCE_FAILED } from '../base/conference';
|
|
3
|
+import { CONFERENCE_FAILED, CONFERENCE_JOINED } from '../base/conference';
|
4
|
4
|
import { NOTIFY_CAMERA_ERROR, NOTIFY_MIC_ERROR } from '../base/devices';
|
5
|
5
|
import { JitsiConferenceErrors } from '../base/lib-jitsi-meet';
|
|
6
|
+import {
|
|
7
|
+ getAvatarURLByParticipantId,
|
|
8
|
+ getLocalParticipant
|
|
9
|
+} from '../base/participants';
|
6
|
10
|
import { MiddlewareRegistry } from '../base/redux';
|
|
11
|
+import { appendSuffix } from '../display-name';
|
7
|
12
|
import { SUBMIT_FEEDBACK } from '../feedback';
|
8
|
13
|
import { SET_FILMSTRIP_VISIBLE } from '../filmstrip';
|
9
|
14
|
|
10
|
15
|
declare var APP: Object;
|
|
16
|
+declare var interfaceConfig: Object;
|
11
|
17
|
|
12
|
18
|
/**
|
13
|
19
|
* The middleware of the feature {@code external-api}.
|
14
|
20
|
*
|
15
|
21
|
* @returns {Function}
|
16
|
22
|
*/
|
17
|
|
-MiddlewareRegistry.register((/* store */) => next => action => {
|
|
23
|
+MiddlewareRegistry.register(store => next => action => {
|
|
24
|
+ const result = next(action);
|
|
25
|
+
|
18
|
26
|
switch (action.type) {
|
19
|
27
|
case CONFERENCE_FAILED: {
|
20
|
28
|
if (action.conference
|
|
@@ -24,6 +32,27 @@ MiddlewareRegistry.register((/* store */) => next => action => {
|
24
|
32
|
break;
|
25
|
33
|
}
|
26
|
34
|
|
|
35
|
+ case CONFERENCE_JOINED: {
|
|
36
|
+ const state = store.getState();
|
|
37
|
+ const { room } = state['features/base/conference'];
|
|
38
|
+ const { name, id } = getLocalParticipant(state);
|
|
39
|
+
|
|
40
|
+ APP.API.notifyConferenceJoined(
|
|
41
|
+ room,
|
|
42
|
+ id,
|
|
43
|
+ {
|
|
44
|
+ displayName: name,
|
|
45
|
+ formattedDisplayName: appendSuffix(
|
|
46
|
+ name,
|
|
47
|
+ interfaceConfig.DEFAULT_LOCAL_DISPLAY_NAME
|
|
48
|
+ ),
|
|
49
|
+ avatarURL: getAvatarURLByParticipantId(state, id)
|
|
50
|
+ }
|
|
51
|
+ );
|
|
52
|
+
|
|
53
|
+ break;
|
|
54
|
+ }
|
|
55
|
+
|
27
|
56
|
case NOTIFY_CAMERA_ERROR:
|
28
|
57
|
if (action.error) {
|
29
|
58
|
APP.API.notifyOnCameraError(
|
|
@@ -46,5 +75,5 @@ MiddlewareRegistry.register((/* store */) => next => action => {
|
46
|
75
|
break;
|
47
|
76
|
}
|
48
|
77
|
|
49
|
|
- return next(action);
|
|
78
|
+ return result;
|
50
|
79
|
});
|