浏览代码

fix(invite-sounds): Don't play joined sound for the poltergeist.

j8
hristoterezov 7 年前
父节点
当前提交
8b91afd80d

+ 1
- 0
conference.js 查看文件

1691
                 conference: room,
1691
                 conference: room,
1692
                 id,
1692
                 id,
1693
                 name: displayName,
1693
                 name: displayName,
1694
+                presence: user.getStatus(),
1694
                 role: user.getRole()
1695
                 role: user.getRole()
1695
             }));
1696
             }));
1696
 
1697
 

+ 0
- 5
modules/UI/UI.js 查看文件

24
 import { JitsiTrackErrors } from '../../react/features/base/lib-jitsi-meet';
24
 import { JitsiTrackErrors } from '../../react/features/base/lib-jitsi-meet';
25
 import {
25
 import {
26
     getLocalParticipant,
26
     getLocalParticipant,
27
-    participantPresenceChanged,
28
     showParticipantJoinedNotification
27
     showParticipantJoinedNotification
29
 } from '../../react/features/base/participants';
28
 } from '../../react/features/base/participants';
30
 import { destroyLocalTracks } from '../../react/features/base/tracks';
29
 import { destroyLocalTracks } from '../../react/features/base/tracks';
487
     const status = user.getStatus();
486
     const status = user.getStatus();
488
 
487
 
489
     if (status) {
488
     if (status) {
490
-        // if user has initial status dispatch it
491
-        // and skip 'connected' notifications
492
-        APP.store.dispatch(participantPresenceChanged(id, status));
493
-
494
         // FIXME: move updateUserStatus in participantPresenceChanged action
489
         // FIXME: move updateUserStatus in participantPresenceChanged action
495
         UI.updateUserStatus(user, status);
490
         UI.updateUserStatus(user, status);
496
     } else {
491
     } else {

+ 7
- 1
react/features/base/participants/middleware.js 查看文件

2
 
2
 
3
 import { APP_WILL_MOUNT, APP_WILL_UNMOUNT } from '../../app';
3
 import { APP_WILL_MOUNT, APP_WILL_UNMOUNT } from '../../app';
4
 import { CONFERENCE_LEFT, CONFERENCE_WILL_JOIN } from '../conference';
4
 import { CONFERENCE_LEFT, CONFERENCE_WILL_JOIN } from '../conference';
5
+import { CALLING, INVITED } from '../../presence-status';
5
 import { MiddlewareRegistry, StateListenerRegistry } from '../redux';
6
 import { MiddlewareRegistry, StateListenerRegistry } from '../redux';
6
 import UIEvents from '../../../../service/UI/UIEvents';
7
 import UIEvents from '../../../../service/UI/UIEvents';
7
 import { playSound, registerSound, unregisterSound } from '../sounds';
8
 import { playSound, registerSound, unregisterSound } from '../sounds';
193
             && (!startAudioMuted
194
             && (!startAudioMuted
194
                 || getParticipantCount(state) < startAudioMuted)) {
195
                 || getParticipantCount(state) < startAudioMuted)) {
195
         if (action.type === PARTICIPANT_JOINED) {
196
         if (action.type === PARTICIPANT_JOINED) {
196
-            dispatch(playSound(PARTICIPANT_JOINED_SOUND_ID));
197
+            const { presence } = action.participant;
198
+
199
+            // The sounds for the poltergeist are handled by features/invite.
200
+            if (presence !== INVITED && presence !== CALLING) {
201
+                dispatch(playSound(PARTICIPANT_JOINED_SOUND_ID));
202
+            }
197
         } else if (action.type === PARTICIPANT_LEFT) {
203
         } else if (action.type === PARTICIPANT_LEFT) {
198
             dispatch(playSound(PARTICIPANT_LEFT_SOUND_ID));
204
             dispatch(playSound(PARTICIPANT_LEFT_SOUND_ID));
199
         }
205
         }

+ 2
- 0
react/features/base/participants/reducer.js 查看文件

175
         local,
175
         local,
176
         name,
176
         name,
177
         pinned,
177
         pinned,
178
+        presence,
178
         role
179
         role
179
     } = participant;
180
     } = participant;
180
     let { avatarID, conference, id } = participant;
181
     let { avatarID, conference, id } = participant;
208
         local: local || false,
209
         local: local || false,
209
         name,
210
         name,
210
         pinned: pinned || false,
211
         pinned: pinned || false,
212
+        presence,
211
         role: role || PARTICIPANT_ROLE.NONE
213
         role: role || PARTICIPANT_ROLE.NONE
212
     };
214
     };
213
 }
215
 }

+ 2
- 0
react/features/invite/middleware.any.js 查看文件

3
 import { APP_WILL_MOUNT, APP_WILL_UNMOUNT } from '../app';
3
 import { APP_WILL_MOUNT, APP_WILL_UNMOUNT } from '../app';
4
 import {
4
 import {
5
     getParticipantPresenceStatus,
5
     getParticipantPresenceStatus,
6
+    PARTICIPANT_JOINED,
6
     PARTICIPANT_JOINED_SOUND_ID,
7
     PARTICIPANT_JOINED_SOUND_ID,
7
     PARTICIPANT_LEFT,
8
     PARTICIPANT_LEFT,
8
     PARTICIPANT_UPDATED
9
     PARTICIPANT_UPDATED
82
         }
83
         }
83
         break;
84
         break;
84
 
85
 
86
+    case PARTICIPANT_JOINED:
85
     case PARTICIPANT_LEFT:
87
     case PARTICIPANT_LEFT:
86
     case PARTICIPANT_UPDATED: {
88
     case PARTICIPANT_UPDATED: {
87
         const newParticipantPresence
89
         const newParticipantPresence

正在加载...
取消
保存