|
@@ -2,6 +2,7 @@
|
2
|
2
|
|
3
|
3
|
import UIEvents from '../../../../service/UI/UIEvents';
|
4
|
4
|
|
|
5
|
+import { showNotification } from '../../notifications';
|
5
|
6
|
import { CALLING, INVITED } from '../../presence-status';
|
6
|
7
|
|
7
|
8
|
import { APP_WILL_MOUNT, APP_WILL_UNMOUNT } from '../app';
|
|
@@ -40,7 +41,8 @@ import {
|
40
|
41
|
getAvatarURLByParticipantId,
|
41
|
42
|
getLocalParticipant,
|
42
|
43
|
getParticipantById,
|
43
|
|
- getParticipantCount
|
|
44
|
+ getParticipantCount,
|
|
45
|
+ getParticipantDisplayName
|
44
|
46
|
} from './functions';
|
45
|
47
|
import { PARTICIPANT_JOINED_FILE, PARTICIPANT_LEFT_FILE } from './sounds';
|
46
|
48
|
|
|
@@ -193,7 +195,7 @@ StateListenerRegistry.register(
|
193
|
195
|
*/
|
194
|
196
|
StateListenerRegistry.register(
|
195
|
197
|
state => state['features/base/conference'].conference,
|
196
|
|
- (conference, { dispatch }) => {
|
|
198
|
+ (conference, store) => {
|
197
|
199
|
if (conference) {
|
198
|
200
|
// We joined a conference
|
199
|
201
|
conference.on(
|
|
@@ -207,13 +209,11 @@ StateListenerRegistry.register(
|
207
|
209
|
features: { 'screen-sharing': true }
|
208
|
210
|
}));
|
209
|
211
|
break;
|
210
|
|
- case 'raisedHand':
|
211
|
|
- dispatch(participantUpdated({
|
212
|
|
- conference,
|
213
|
|
- id: participant.getId(),
|
214
|
|
- raisedHand: newValue === 'true'
|
215
|
|
- }));
|
|
212
|
+ case 'raisedHand': {
|
|
213
|
+ _raiseHandUpdated(
|
|
214
|
+ store, conference, participant, newValue);
|
216
|
215
|
break;
|
|
216
|
+ }
|
217
|
217
|
default:
|
218
|
218
|
|
219
|
219
|
// Ignore for now.
|
|
@@ -371,6 +371,34 @@ function _participantJoinedOrUpdated({ getState }, next, action) {
|
371
|
371
|
return next(action);
|
372
|
372
|
}
|
373
|
373
|
|
|
374
|
+/**
|
|
375
|
+ * Handles a raise hand status update.
|
|
376
|
+ *
|
|
377
|
+ * @param {Function} dispatch - The Redux dispatch function.
|
|
378
|
+ * @param {Object} conference - The conference for which we got an update.
|
|
379
|
+ * @param {*} participant - The participant from which we got an update.
|
|
380
|
+ * @param {*} newValue - The new value of the raise hand status.
|
|
381
|
+ * @returns {void}
|
|
382
|
+ */
|
|
383
|
+function _raiseHandUpdated({ dispatch, getState }, conference, participant, newValue) {
|
|
384
|
+ const raisedHand = newValue === 'true';
|
|
385
|
+
|
|
386
|
+ dispatch(participantUpdated({
|
|
387
|
+ conference,
|
|
388
|
+ id: participant.getId(),
|
|
389
|
+ raisedHand
|
|
390
|
+ }));
|
|
391
|
+
|
|
392
|
+ if (raisedHand) {
|
|
393
|
+ dispatch(showNotification({
|
|
394
|
+ titleArguments: {
|
|
395
|
+ name: getParticipantDisplayName(getState, participant.getId())
|
|
396
|
+ },
|
|
397
|
+ titleKey: 'notify.raisedHand'
|
|
398
|
+ }, 2500));
|
|
399
|
+ }
|
|
400
|
+}
|
|
401
|
+
|
374
|
402
|
/**
|
375
|
403
|
* Registers sounds related with the participants feature.
|
376
|
404
|
*
|