Skip to content

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.

fix(dominant-speaker): Lower hand through xmpp for dominant speaker (#10220)

Horatiu Muresan2cfa5f63129f
diff --git a/react/features/base/participants/middleware.js b/react/features/base/participants/middleware.js
index d985f431e9..844632c7fe 100644
--- a/react/features/base/participants/middleware.js
+++ b/react/features/base/participants/middleware.js
@@ -60,6 +60,8 @@ import {
} from './functions';
import { PARTICIPANT_JOINED_FILE, PARTICIPANT_LEFT_FILE } from './sounds';
+import { hasRaisedHand, raiseHand } from '.';
+
declare var APP: Object;
/**
@@ -86,27 +88,14 @@ MiddlewareRegistry.register(store => next => action => {
break;
case DOMINANT_SPEAKER_CHANGED: {
- // Ensure the raised hand state is cleared for the dominant speaker
- // and only if it was set when this is the local participant
-
- const { conference, id } = action.participant;
+ // Lower hand through xmpp when local participant becomes dominant speaker.
+ const { id } = action.participant;
const state = store.getState();
const participant = getLocalParticipant(state);
const isLocal = participant && participant.id === id;
- if (isLocal && participant.raisedHandTimestamp === undefined) {
- // if local was undefined, let's leave it like that
- // avoids sending unnecessary presence updates
- break;
- }
-
- if (!getDisableRemoveRaisedHandOnFocus(state)) {
- participant && store.dispatch(participantUpdated({
- conference,
- id,
- local: isLocal,
- raisedHandTimestamp: 0
- }));
+ if (isLocal && hasRaisedHand(participant) && !getDisableRemoveRaisedHandOnFocus(state)) {
+ store.dispatch(raiseHand(false));
}
break;