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

This commit is contained in:
hristoterezov 2018-05-21 16:40:15 -05:00 committed by Дамян Минков
parent d89227829f
commit 8b91afd80d
5 changed files with 12 additions and 6 deletions

View File

@ -1691,6 +1691,7 @@ export default {
conference: room,
id,
name: displayName,
presence: user.getStatus(),
role: user.getRole()
}));

View File

@ -24,7 +24,6 @@ import { updateDeviceList } from '../../react/features/base/devices';
import { JitsiTrackErrors } from '../../react/features/base/lib-jitsi-meet';
import {
getLocalParticipant,
participantPresenceChanged,
showParticipantJoinedNotification
} from '../../react/features/base/participants';
import { destroyLocalTracks } from '../../react/features/base/tracks';
@ -487,10 +486,6 @@ UI.addUser = function(user) {
const status = user.getStatus();
if (status) {
// if user has initial status dispatch it
// and skip 'connected' notifications
APP.store.dispatch(participantPresenceChanged(id, status));
// FIXME: move updateUserStatus in participantPresenceChanged action
UI.updateUserStatus(user, status);
} else {

View File

@ -2,6 +2,7 @@
import { APP_WILL_MOUNT, APP_WILL_UNMOUNT } from '../../app';
import { CONFERENCE_LEFT, CONFERENCE_WILL_JOIN } from '../conference';
import { CALLING, INVITED } from '../../presence-status';
import { MiddlewareRegistry, StateListenerRegistry } from '../redux';
import UIEvents from '../../../../service/UI/UIEvents';
import { playSound, registerSound, unregisterSound } from '../sounds';
@ -193,7 +194,12 @@ function _maybePlaySounds({ getState, dispatch }, action) {
&& (!startAudioMuted
|| getParticipantCount(state) < startAudioMuted)) {
if (action.type === PARTICIPANT_JOINED) {
dispatch(playSound(PARTICIPANT_JOINED_SOUND_ID));
const { presence } = action.participant;
// The sounds for the poltergeist are handled by features/invite.
if (presence !== INVITED && presence !== CALLING) {
dispatch(playSound(PARTICIPANT_JOINED_SOUND_ID));
}
} else if (action.type === PARTICIPANT_LEFT) {
dispatch(playSound(PARTICIPANT_LEFT_SOUND_ID));
}

View File

@ -175,6 +175,7 @@ function _participantJoined({ participant }) {
local,
name,
pinned,
presence,
role
} = participant;
let { avatarID, conference, id } = participant;
@ -208,6 +209,7 @@ function _participantJoined({ participant }) {
local: local || false,
name,
pinned: pinned || false,
presence,
role: role || PARTICIPANT_ROLE.NONE
};
}

View File

@ -3,6 +3,7 @@
import { APP_WILL_MOUNT, APP_WILL_UNMOUNT } from '../app';
import {
getParticipantPresenceStatus,
PARTICIPANT_JOINED,
PARTICIPANT_JOINED_SOUND_ID,
PARTICIPANT_LEFT,
PARTICIPANT_UPDATED
@ -82,6 +83,7 @@ MiddlewareRegistry.register(store => next => action => {
}
break;
case PARTICIPANT_JOINED:
case PARTICIPANT_LEFT:
case PARTICIPANT_UPDATED: {
const newParticipantPresence