ソースを参照

fix: Skip sending unnecessary signalling for raise hand.

j8
damencho 4年前
コミット
ec6abc1ce9
1個のファイルの変更14行の追加6行の削除
  1. 14
    6
      react/features/base/participants/middleware.js

+ 14
- 6
react/features/base/participants/middleware.js ファイルの表示

@@ -71,16 +71,24 @@ MiddlewareRegistry.register(store => next => action => {
71 71
         break;
72 72
 
73 73
     case DOMINANT_SPEAKER_CHANGED: {
74
-        // Ensure the raised hand state is cleared for the dominant speaker.
74
+        // Ensure the raised hand state is cleared for the dominant speaker
75
+        // and only if it was set when this is the local participant
75 76
 
76 77
         const { conference, id } = action.participant;
77 78
         const participant = getLocalParticipant(store.getState());
79
+        const isLocal = participant && participant.id === id;
80
+
81
+        if (isLocal && participant.raisedHand === undefined) {
82
+            // if local was undefined, let's leave it like that
83
+            // avoids sending unnecessary presence updates
84
+            break;
85
+        }
78 86
 
79 87
         participant
80 88
             && store.dispatch(participantUpdated({
81 89
                 conference,
82 90
                 id,
83
-                local: participant.id === id,
91
+                local: isLocal,
84 92
                 raisedHand: false
85 93
             }));
86 94
 
@@ -369,10 +377,10 @@ function _participantJoinedOrUpdated(store, next, action) {
369 377
         if (local) {
370 378
             const { conference } = getState()['features/base/conference'];
371 379
 
372
-            conference
373
-                && conference.setLocalParticipantProperty(
374
-                    'raisedHand',
375
-                    raisedHand);
380
+            // Send raisedHand signalling only if there is a change
381
+            if (conference && raisedHand !== getLocalParticipant(getState()).raisedHand) {
382
+                conference.setLocalParticipantProperty('raisedHand', raisedHand);
383
+            }
376 384
         }
377 385
     }
378 386
 

読み込み中…
キャンセル
保存