瀏覽代碼

fix(conference): Don't use this._room.

this._room should be used only by jitsi-meet-torture and for test purposes. Also this._room is assigned later than room. This may cause some issues, for example conference.getMyUserId() may return undefined while the user id is already available beacuse this._room hasn't been assigned yet.
master
Hristo Terezov 6 年之前
父節點
當前提交
48285e8a2d
共有 1 個檔案被更改,包括 10 行新增13 行删除
  1. 10
    13
      conference.js

+ 10
- 13
conference.js 查看文件

948
      * Returns the connection times stored in the library.
948
      * Returns the connection times stored in the library.
949
      */
949
      */
950
     getConnectionTimes() {
950
     getConnectionTimes() {
951
-        return this._room.getConnectionTimes();
951
+        return room.getConnectionTimes();
952
     },
952
     },
953
 
953
 
954
     // used by torture currently
954
     // used by torture currently
955
     isJoined() {
955
     isJoined() {
956
-        return this._room
957
-            && this._room.isJoined();
956
+        return room && room.isJoined();
958
     },
957
     },
959
     getConnectionState() {
958
     getConnectionState() {
960
-        return this._room
961
-            && this._room.getConnectionState();
959
+        return room && room.getConnectionState();
962
     },
960
     },
963
 
961
 
964
     /**
962
     /**
967
      * P2P connection
965
      * P2P connection
968
      */
966
      */
969
     getP2PConnectionState() {
967
     getP2PConnectionState() {
970
-        return this._room
971
-            && this._room.getP2PConnectionState();
968
+        return room && room.getP2PConnectionState();
972
     },
969
     },
973
 
970
 
974
     /**
971
     /**
977
      */
974
      */
978
     _startP2P() {
975
     _startP2P() {
979
         try {
976
         try {
980
-            this._room && this._room.startP2PSession();
977
+            room && room.startP2PSession();
981
         } catch (error) {
978
         } catch (error) {
982
             logger.error('Start P2P failed', error);
979
             logger.error('Start P2P failed', error);
983
             throw error;
980
             throw error;
990
      */
987
      */
991
     _stopP2P() {
988
     _stopP2P() {
992
         try {
989
         try {
993
-            this._room && this._room.stopP2PSession();
990
+            room && room.stopP2PSession();
994
         } catch (error) {
991
         } catch (error) {
995
             logger.error('Stop P2P failed', error);
992
             logger.error('Stop P2P failed', error);
996
             throw error;
993
             throw error;
1005
      * false otherwise.
1002
      * false otherwise.
1006
      */
1003
      */
1007
     isConnectionInterrupted() {
1004
     isConnectionInterrupted() {
1008
-        return this._room.isConnectionInterrupted();
1005
+        return room.isConnectionInterrupted();
1009
     },
1006
     },
1010
 
1007
 
1011
     /**
1008
     /**
1066
     },
1063
     },
1067
 
1064
 
1068
     getMyUserId() {
1065
     getMyUserId() {
1069
-        return this._room && this._room.myUserId();
1066
+        return room && room.myUserId();
1070
     },
1067
     },
1071
 
1068
 
1072
     /**
1069
     /**
1089
      * least one track.
1086
      * least one track.
1090
      */
1087
      */
1091
     getNumberOfParticipantsWithTracks() {
1088
     getNumberOfParticipantsWithTracks() {
1092
-        return this._room.getParticipants()
1089
+        return room.getParticipants()
1093
             .filter(p => p.getTracks().length > 0)
1090
             .filter(p => p.getTracks().length > 0)
1094
             .length;
1091
             .length;
1095
     },
1092
     },
2206
 
2203
 
2207
         if (config.requireDisplayName
2204
         if (config.requireDisplayName
2208
                 && !APP.conference.getLocalDisplayName()
2205
                 && !APP.conference.getLocalDisplayName()
2209
-                && !this._room.isHidden()) {
2206
+                && !room.isHidden()) {
2210
             APP.UI.promptDisplayName();
2207
             APP.UI.promptDisplayName();
2211
         }
2208
         }
2212
 
2209
 

Loading…
取消
儲存