Skip to content

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

Platform generic notification for raised hand

Bettenbuk Zoltan6ff733dae047
diff --git a/lang/main.json b/lang/main.json
index 2228ee4e4b..06c40bf71d 100644
--- a/lang/main.json
+++ b/lang/main.json
@@ -469,7 +469,7 @@
"moderator": "Moderator rights granted!",
"muted": "You have started the conversation muted.",
"mutedTitle": "You're muted!",
- "raisedHand": "Would like to speak.",
+ "raisedHand": "__name__ would like to speak.",
"somebody": "Somebody",
"suboptimalExperienceDescription": "Eer... we are afraid your experience with __appName__ isn't going to be that great here. We are looking for ways to improve this but, until then, please try using one of the <a href='static/recommendedBrowsers.html' target='_blank'>fully supported browsers</a>.",
"suboptimalExperienceTitle": "Browser Warning"
diff --git a/modules/UI/UI.js b/modules/UI/UI.js
index 02e1d865a3..d178b80d06 100644
--- a/modules/UI/UI.js
+++ b/modules/UI/UI.js
@@ -188,13 +188,6 @@ UI.changeDisplayName = function(id, displayName) {
*/
UI.setRaisedHandStatus = (id, name, raisedHandStatus) => {
VideoLayout.setRaisedHandStatus(id, raisedHandStatus);
- if (raisedHandStatus) {
- messageHandler.participantNotification(
- name,
- 'notify.somebody',
- 'connected',
- 'notify.raisedHand');
- }
};
/**
diff --git a/react/features/base/participants/middleware.js b/react/features/base/participants/middleware.js
index 7f43f5e097..7eb125b169 100644
--- a/react/features/base/participants/middleware.js
+++ b/react/features/base/participants/middleware.js
@@ -2,6 +2,7 @@
import UIEvents from '../../../../service/UI/UIEvents';
+import { showNotification } from '../../notifications';
import { CALLING, INVITED } from '../../presence-status';
import { APP_WILL_MOUNT, APP_WILL_UNMOUNT } from '../app';
@@ -40,7 +41,8 @@ import {
getAvatarURLByParticipantId,
getLocalParticipant,
getParticipantById,
- getParticipantCount
+ getParticipantCount,
+ getParticipantDisplayName
} from './functions';
import { PARTICIPANT_JOINED_FILE, PARTICIPANT_LEFT_FILE } from './sounds';
@@ -193,7 +195,7 @@ StateListenerRegistry.register(
*/
StateListenerRegistry.register(
state => state['features/base/conference'].conference,
- (conference, { dispatch }) => {
+ (conference, store) => {
if (conference) {
// We joined a conference
conference.on(
@@ -207,13 +209,11 @@ StateListenerRegistry.register(
features: { 'screen-sharing': true }
}));
break;
- case 'raisedHand':
- dispatch(participantUpdated({
- conference,
- id: participant.getId(),
- raisedHand: newValue === 'true'
- }));
+ case 'raisedHand': {
+ _raiseHandUpdated(
+ store, conference, participant, newValue);
break;
+ }
default:
// Ignore for now.
@@ -371,6 +371,34 @@ function _participantJoinedOrUpdated({ getState }, next, action) {
return next(action);
}
+/**
+ * Handles a raise hand status update.
+ *
+ * @param {Function} dispatch - The Redux dispatch function.
+ * @param {Object} conference - The conference for which we got an update.
+ * @param {*} participant - The participant from which we got an update.
+ * @param {*} newValue - The new value of the raise hand status.
+ * @returns {void}
+ */
+function _raiseHandUpdated({ dispatch, getState }, conference, participant, newValue) {
+ const raisedHand = newValue === 'true';
+
+ dispatch(participantUpdated({
+ conference,
+ id: participant.getId(),
+ raisedHand
+ }));
+
+ if (raisedHand) {
+ dispatch(showNotification({
+ titleArguments: {
+ name: getParticipantDisplayName(getState, participant.getId())
+ },
+ titleKey: 'notify.raisedHand'
+ }, 2500));
+ }
+}
+
/**
* Registers sounds related with the participants feature.
*