Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(keep-hand-raised-notification-when-the-hands-will-be-auto-lowered) #14960

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions lang/main.json
Original file line number Diff line number Diff line change
Expand Up @@ -754,6 +754,7 @@
"invitedThreePlusMembers": "{{name}} and {{count}} others have been invited",
"invitedTwoMembers": "{{first}} and {{second}} have been invited",
"joinMeeting": "Join",
"keepHandsRaised": "Keep it Raised",
"kickParticipant": "{{kicked}} was kicked by {{kicker}}",
"leftOneMember": "{{name}} left the meeting",
"leftThreePlusMembers": "{{name}} and many others left the meeting",
Expand All @@ -766,6 +767,7 @@
"linkToSalesforceSuccess": "The meeting was linked to Salesforce",
"localRecordingStarted": "{{name}} has started a local recording.",
"localRecordingStopped": "{{name}} has stopped a local recording.",
"lowerRaisedHandsNotificationTitle": "It sounds like you've said something, so your hand will be lowered",
"me": "Me",
"moderationInEffectCSDescription": "Please raise hand if you want to share your screen.",
"moderationInEffectCSTitle": "Screen sharing is blocked by the moderator",
Expand Down
2 changes: 1 addition & 1 deletion react/features/base/config/configType.ts
Original file line number Diff line number Diff line change
Expand Up @@ -489,9 +489,9 @@ export interface IConfig {
prejoinPageEnabled?: boolean;
raisedHands?: {
disableLowerHandByModerator?: boolean;
disableLowerHandNotification?: boolean;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This serves the same purpose as 'disableRemoveRaisedHandOnFocusNotification'. Since I think the new name is clearer, I’ve updated it accordingly. Please let me know any advice.

disableNextSpeakerNotification?: boolean;
disableRemoveRaisedHandOnFocus?: boolean;
disableRemoveRaisedHandOnFocusNotification?: boolean;
};
readOnlyName?: boolean;
recordingLimit?: {
Expand Down
12 changes: 6 additions & 6 deletions react/features/base/config/functions.any.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,23 +103,23 @@ export function getDisableLowerHandByModerator(state: IReduxState) {
}

/**
* Selector used to get the disableLowerHandNotification.
* Selector used to get the disableNextSpeakerNotification.
*
* @param {Object} state - The global state.
* @returns {boolean}
*/
export function getDisableLowerHandNotification(state: IReduxState) {
return state['features/base/config']?.raisedHands?.disableLowerHandNotification || true;
export function getDisableNextSpeakerNotification(state: IReduxState) {
return state['features/base/config']?.raisedHands?.disableNextSpeakerNotification || false;
}

/**
* Selector used to get the disableNextSpeakerNotification.
* Selector used to get the disableRemoveRaisedHandOnFocusNotification.
*
* @param {Object} state - The global state.
* @returns {boolean}
*/
export function getDisableNextSpeakerNotification(state: IReduxState) {
return state['features/base/config']?.raisedHands?.disableNextSpeakerNotification || false;
export function getDisableRemoveRaisedHandOnFocusNotification(state: IReduxState) {
return state['features/base/config']?.raisedHands?.disableRemoveRaisedHandOnFocusNotification || false;
}

/**
Expand Down
27 changes: 24 additions & 3 deletions react/features/base/participants/middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,11 @@ import { UPDATE_BREAKOUT_ROOMS } from '../../breakout-rooms/actionTypes';
import { getBreakoutRooms } from '../../breakout-rooms/functions';
import { toggleE2EE } from '../../e2ee/actions';
import { MAX_MODE } from '../../e2ee/constants';
import { showNotification } from '../../notifications/actions';
import { hideNotification, showNotification } from '../../notifications/actions';
import {
LOCAL_RECORDING_NOTIFICATION_ID,
LOWER_RAISED_HANDS_ID,
NOTIFICATION_TIMEOUT,
NOTIFICATION_TIMEOUT_TYPE,
RAISE_HAND_NOTIFICATION_ID
} from '../../notifications/constants';
Expand All @@ -24,7 +26,10 @@ import { CONFERENCE_JOINED, CONFERENCE_WILL_JOIN } from '../conference/actionTyp
import { forEachConference, getCurrentConference } from '../conference/functions';
import { IJitsiConference } from '../conference/reducer';
import { SET_CONFIG } from '../config/actionTypes';
import { getDisableRemoveRaisedHandOnFocus } from '../config/functions.any';
import {
getDisableRemoveRaisedHandOnFocus,
getDisableRemoveRaisedHandOnFocusNotification
} from '../config/functions.any';
import { JitsiConferenceEvents } from '../lib-jitsi-meet';
import { MEDIA_TYPE } from '../media/constants';
import MiddlewareRegistry from '../redux/MiddlewareRegistry';
Expand Down Expand Up @@ -117,7 +122,23 @@ MiddlewareRegistry.register(store => next => action => {
if (isLocal && dominantSpeaker?.id !== id
&& hasRaisedHand(participant)
&& !getDisableRemoveRaisedHandOnFocus(state)) {
store.dispatch(raiseHand(false));
if (getDisableRemoveRaisedHandOnFocusNotification(state)) {
store.dispatch(raiseHand(false));
} else {
const timeoutId = setTimeout(() => {
store.dispatch(raiseHand(false));
}, NOTIFICATION_TIMEOUT.SHORT);

store.dispatch(showNotification({
titleKey: 'notify.lowerRaisedHandsNotificationTitle',
uid: LOWER_RAISED_HANDS_ID,
customActionNameKey: [ 'notify.keepHandsRaised' ],
customActionHandler: [ () => {
clearTimeout(timeoutId);
store.dispatch(hideNotification(LOWER_RAISED_HANDS_ID));
} ]
}, NOTIFICATION_TIMEOUT_TYPE.SHORT));
}
}

break;
Expand Down
7 changes: 7 additions & 0 deletions react/features/notifications/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,13 @@ export const LOBBY_NOTIFICATION_ID = 'LOBBY_NOTIFICATION';
*/
export const LOCAL_RECORDING_NOTIFICATION_ID = 'LOCAL_RECORDING_NOTIFICATION_ID';

/**
* The identifier of the lower raised hand notification.
*
* @type {string}
*/
export const LOWER_RAISED_HANDS_ID = 'LOWER_RAISED_HANDS_ID';

/**
* The identifier of the raise hand notification.
*
Expand Down