瀏覽代碼

fix(eslint): Add no-multi-spaces rule

dev1
hristoterezov 8 年之前
父節點
當前提交
c96898c478
共有 42 個文件被更改,包括 260 次插入259 次删除
  1. 1
    0
      .eslintrc.js
  2. 20
    20
      JitsiConference.js
  3. 4
    4
      JitsiConferenceEventManager.js
  4. 2
    2
      JitsiConnection.js
  5. 1
    1
      JitsiMediaDevices.js
  6. 3
    3
      JitsiMeetJS.js
  7. 8
    8
      doc/example/example.js
  8. 8
    8
      modules/RTC/DataChannels.js
  9. 13
    13
      modules/RTC/JitsiLocalTrack.js
  10. 10
    10
      modules/RTC/JitsiRemoteTrack.js
  11. 10
    10
      modules/RTC/JitsiTrack.js
  12. 5
    5
      modules/RTC/RTC.js
  13. 1
    1
      modules/RTC/RTCBrowserType.js
  14. 7
    7
      modules/RTC/RTCUtils.js
  15. 7
    7
      modules/RTC/ScreenObtainer.js
  16. 2
    2
      modules/RTC/TraceablePeerConnection.js
  17. 3
    3
      modules/TalkMutedDetection.js
  18. 8
    8
      modules/connectivity/ConnectionQuality.js
  19. 3
    3
      modules/statistics/CallStats.js
  20. 4
    4
      modules/statistics/LocalStatsCollector.js
  21. 18
    18
      modules/statistics/RTPStatsCollector.js
  22. 18
    18
      modules/statistics/statistics.js
  23. 7
    7
      modules/transcription/audioRecorder.js
  24. 3
    3
      modules/transcription/transcriber.js
  25. 1
    1
      modules/transcription/transcriptionServices/AbstractTranscriptionService.js
  26. 3
    3
      modules/transcription/transcriptionServices/SphinxTranscriptionService.js
  27. 1
    1
      modules/util/EventEmitterForwarder.js
  28. 4
    4
      modules/util/GlobalOnErrorHandler.js
  29. 3
    3
      modules/util/ScriptUtil.js
  30. 1
    1
      modules/util/UsernameGenerator.js
  31. 1
    1
      modules/version/ComponentsVersions.js
  32. 1
    1
      modules/xmpp/Caps.js
  33. 23
    23
      modules/xmpp/ChatRoom.js
  34. 11
    11
      modules/xmpp/JingleSessionPC.js
  35. 1
    1
      modules/xmpp/RtxModifier.js
  36. 9
    9
      modules/xmpp/SDP.js
  37. 4
    4
      modules/xmpp/SDPDiffer.js
  38. 2
    2
      modules/xmpp/SDPUtil.js
  39. 11
    11
      modules/xmpp/moderator.js
  40. 9
    9
      modules/xmpp/recording.js
  41. 5
    5
      modules/xmpp/strophe.emuc.js
  42. 4
    4
      modules/xmpp/xmpp.js

+ 1
- 0
.eslintrc.js 查看文件

@@ -76,6 +76,7 @@ module.exports = {
76 76
         'complexity': 0,
77 77
         'consistent-return': 0,
78 78
         'curly': 2,
79
+        'no-multi-spaces': 2,
79 80
 
80 81
         // Stylistic issues group
81 82
         'brace-style': 2,

+ 20
- 20
JitsiConference.js 查看文件

@@ -94,7 +94,7 @@ function JitsiConference(options) {
94 94
  * @param connection {JitsiConnection} overrides this.connection
95 95
  */
96 96
 JitsiConference.prototype._init = function (options) {
97
-    if (!options)        {
97
+    if (!options) {
98 98
         options = {};
99 99
     }
100 100
 
@@ -152,7 +152,7 @@ JitsiConference.prototype._init = function (options) {
152 152
  * @param password {string} the password
153 153
  */
154 154
 JitsiConference.prototype.join = function (password) {
155
-    if (this.room)        {
155
+    if (this.room) {
156 156
         this.room.join(password);
157 157
     }
158 158
 };
@@ -177,7 +177,7 @@ JitsiConference.prototype.leave = function () {
177 177
     this.getLocalTracks().forEach(track => this.onLocalTrackRemoved(track));
178 178
 
179 179
     this.rtc.closeAllDataChannels();
180
-    if (this.statistics)        {
180
+    if (this.statistics) {
181 181
         this.statistics.dispose();
182 182
     }
183 183
 
@@ -297,7 +297,7 @@ JitsiConference.prototype.getLocalVideoTrack = function () {
297 297
  * Note: consider adding eventing functionality by extending an EventEmitter impl, instead of rolling ourselves
298 298
  */
299 299
 JitsiConference.prototype.on = function (eventId, handler) {
300
-    if (this.eventEmitter)        {
300
+    if (this.eventEmitter) {
301 301
         this.eventEmitter.on(eventId, handler);
302 302
     }
303 303
 };
@@ -310,7 +310,7 @@ JitsiConference.prototype.on = function (eventId, handler) {
310 310
  * Note: consider adding eventing functionality by extending an EventEmitter impl, instead of rolling ourselves
311 311
  */
312 312
 JitsiConference.prototype.off = function (eventId, handler) {
313
-    if (this.eventEmitter)        {
313
+    if (this.eventEmitter) {
314 314
         this.eventEmitter.removeListener(eventId, handler);
315 315
     }
316 316
 };
@@ -326,7 +326,7 @@ JitsiConference.prototype.removeEventListener = JitsiConference.prototype.off;
326 326
  * @param handler {Function} handler for the command
327 327
  */
328 328
 JitsiConference.prototype.addCommandListener = function (command, handler) {
329
-    if (this.room)        {
329
+    if (this.room) {
330 330
         this.room.addPresenceListener(command, handler);
331 331
     }
332 332
 };
@@ -336,7 +336,7 @@ JitsiConference.prototype.addCommandListener = function (command, handler) {
336 336
   * @param command {String} the name of the command
337 337
   */
338 338
 JitsiConference.prototype.removeCommandListener = function (command) {
339
-    if (this.room)        {
339
+    if (this.room) {
340 340
         this.room.removePresenceListener(command);
341 341
     }
342 342
 };
@@ -346,7 +346,7 @@ JitsiConference.prototype.removeCommandListener = function (command) {
346 346
  * @param message the text message.
347 347
  */
348 348
 JitsiConference.prototype.sendTextMessage = function (message) {
349
-    if (this.room)        {
349
+    if (this.room) {
350 350
         this.room.sendMessage(message);
351 351
     }
352 352
 };
@@ -378,7 +378,7 @@ JitsiConference.prototype.sendCommandOnce = function (name, values) {
378 378
  * @param name {String} the name of the command.
379 379
  **/
380 380
 JitsiConference.prototype.removeCommand = function (name) {
381
-    if (this.room)        {
381
+    if (this.room) {
382 382
         this.room.removeFromPresence(name);
383 383
     }
384 384
 };
@@ -496,7 +496,7 @@ JitsiConference.prototype.onLocalTrackRemoved = function (track) {
496 496
     // send event for stopping screen sharing
497 497
     // FIXME: we assume we have only one screen sharing track
498 498
     // if we change this we need to fix this check
499
-    if (track.isVideoTrack() && track.videoType === VideoType.DESKTOP)        {
499
+    if (track.isVideoTrack() && track.videoType === VideoType.DESKTOP) {
500 500
         this.statistics.sendScreenSharingEvent(false);
501 501
     }
502 502
 
@@ -635,7 +635,7 @@ JitsiConference.prototype._setupNewTrack = function (newTrack) {
635 635
     // send event for starting screen sharing
636 636
     // FIXME: we assume we have only one screen sharing track
637 637
     // if we change this we need to fix this check
638
-    if (newTrack.isVideoTrack() && newTrack.videoType === VideoType.DESKTOP)        {
638
+    if (newTrack.isVideoTrack() && newTrack.videoType === VideoType.DESKTOP) {
639 639
         this.statistics.sendScreenSharingEvent(true);
640 640
     }
641 641
 
@@ -888,7 +888,7 @@ JitsiConference.prototype.onMemberLeft = function (jid) {
888 888
     }.bind(this));
889 889
 
890 890
     // there can be no participant in case the member that left is focus
891
-    if (participant)        {
891
+    if (participant) {
892 892
         this.eventEmitter.emit(
893 893
             JitsiConferenceEvents.USER_LEFT, id, participant);
894 894
     }
@@ -911,7 +911,7 @@ JitsiConference.prototype.onDisplayNameChanged = function (jid, displayName) {
911 911
         return;
912 912
     }
913 913
 
914
-    if (participant._displayName === displayName)        {
914
+    if (participant._displayName === displayName) {
915 915
         return;
916 916
     }
917 917
 
@@ -1230,7 +1230,7 @@ JitsiConference.prototype.sendTones = function (tones, duration, pause) {
1230 1230
  * Returns true if recording is supported and false if not.
1231 1231
  */
1232 1232
 JitsiConference.prototype.isRecordingSupported = function () {
1233
-    if (this.room)        {
1233
+    if (this.room) {
1234 1234
         return this.room.isRecordingSupported();
1235 1235
     }
1236 1236
     return false;
@@ -1255,7 +1255,7 @@ JitsiConference.prototype.getRecordingURL = function () {
1255 1255
  * Starts/stops the recording
1256 1256
  */
1257 1257
 JitsiConference.prototype.toggleRecording = function (options) {
1258
-    if (this.room)        {
1258
+    if (this.room) {
1259 1259
         return this.room.toggleRecording(options, function (status, error) {
1260 1260
             this.eventEmitter.emit(
1261 1261
                 JitsiConferenceEvents.RECORDER_STATE_CHANGED, status, error);
@@ -1270,7 +1270,7 @@ JitsiConference.prototype.toggleRecording = function (options) {
1270 1270
  * Returns true if the SIP calls are supported and false otherwise
1271 1271
  */
1272 1272
 JitsiConference.prototype.isSIPCallingSupported = function () {
1273
-    if (this.room)        {
1273
+    if (this.room) {
1274 1274
         return this.room.isSIPCallingSupported();
1275 1275
     }
1276 1276
     return false;
@@ -1281,7 +1281,7 @@ JitsiConference.prototype.isSIPCallingSupported = function () {
1281 1281
  * @param number the number
1282 1282
  */
1283 1283
 JitsiConference.prototype.dial = function (number) {
1284
-    if (this.room)        {
1284
+    if (this.room) {
1285 1285
         return this.room.dial(number);
1286 1286
     }
1287 1287
     return new Promise(function(resolve, reject){
@@ -1293,7 +1293,7 @@ JitsiConference.prototype.dial = function (number) {
1293 1293
  * Hangup an existing call
1294 1294
  */
1295 1295
 JitsiConference.prototype.hangup = function () {
1296
-    if (this.room)        {
1296
+    if (this.room) {
1297 1297
         return this.room.hangup();
1298 1298
     }
1299 1299
     return new Promise(function(resolve, reject){
@@ -1305,7 +1305,7 @@ JitsiConference.prototype.hangup = function () {
1305 1305
  * Returns the phone number for joining the conference.
1306 1306
  */
1307 1307
 JitsiConference.prototype.getPhoneNumber = function () {
1308
-    if (this.room)        {
1308
+    if (this.room) {
1309 1309
         return this.room.getPhoneNumber();
1310 1310
     }
1311 1311
     return null;
@@ -1315,7 +1315,7 @@ JitsiConference.prototype.getPhoneNumber = function () {
1315 1315
  * Returns the pin for joining the conference with phone.
1316 1316
  */
1317 1317
 JitsiConference.prototype.getPhonePin = function () {
1318
-    if (this.room)        {
1318
+    if (this.room) {
1319 1319
         return this.room.getPhonePin();
1320 1320
     }
1321 1321
     return null;

+ 4
- 4
JitsiConferenceEventManager.js 查看文件

@@ -23,7 +23,7 @@ function JitsiConferenceEventManager(conference) {
23 23
     //Listeners related to the conference only
24 24
     conference.on(JitsiConferenceEvents.TRACK_MUTE_CHANGED,
25 25
         function (track) {
26
-            if(!track.isLocal() || !conference.statistics)                {
26
+            if(!track.isLocal() || !conference.statistics) {
27 27
                 return;
28 28
             }
29 29
             conference.statistics.sendMuteEvent(track.isMuted(),
@@ -528,13 +528,13 @@ JitsiConferenceEventManager.prototype.setupXMPPListeners = function () {
528 528
  */
529 529
 JitsiConferenceEventManager.prototype.setupStatisticsListeners = function () {
530 530
     var conference = this.conference;
531
-    if(!conference.statistics)        {
531
+    if(!conference.statistics) {
532 532
         return;
533 533
     }
534 534
 
535 535
     conference.statistics.addAudioLevelListener(function (ssrc, level) {
536 536
         var resource = conference.rtc.getResourceBySSRC(ssrc);
537
-        if (!resource)            {
537
+        if (!resource) {
538 538
             return;
539 539
         }
540 540
 
@@ -581,7 +581,7 @@ JitsiConferenceEventManager.prototype.setupStatisticsListeners = function () {
581 581
     conference.statistics.addByteSentStatsListener(function (stats) {
582 582
         conference.getLocalTracks(MediaType.AUDIO).forEach(function (track) {
583 583
             const ssrc = track.getSSRC();
584
-            if (!ssrc || !stats.hasOwnProperty(ssrc))                {
584
+            if (!ssrc || !stats.hasOwnProperty(ssrc)) {
585 585
                 return;
586 586
             }
587 587
 

+ 2
- 2
JitsiConnection.js 查看文件

@@ -29,7 +29,7 @@ function JitsiConnection(appID, token, options) {
29 29
             // we can see disconnects from normal tab closing of the browser
30 30
             // and then there are no msgs, but we want to log only disconnects
31 31
             // when there is real error
32
-            if(msg)                {
32
+            if(msg) {
33 33
                 Statistics.analytics.sendEvent(
34 34
                     'connection.disconnected.' + msg);
35 35
             }
@@ -44,7 +44,7 @@ function JitsiConnection(appID, token, options) {
44 44
  * (for example authentications parameters).
45 45
  */
46 46
 JitsiConnection.prototype.connect = function (options) {
47
-    if(!options)        {
47
+    if(!options) {
48 48
         options = {};
49 49
     }
50 50
 

+ 1
- 1
JitsiMediaDevices.js 查看文件

@@ -100,7 +100,7 @@ var JitsiMediaDevices = {
100 100
     setAudioOutputDevice: function (deviceId) {
101 101
 
102 102
         var availableDevices = RTC.getCurrentlyAvailableMediaDevices();
103
-        if (availableDevices && availableDevices.length > 0)        {
103
+        if (availableDevices && availableDevices.length > 0) {
104 104
             // if we have devices info report device to stats
105 105
             // normally this will not happen on startup as this method is called
106 106
             // too early. This will happen only on user selection of new device

+ 3
- 3
JitsiMeetJS.js 查看文件

@@ -31,7 +31,7 @@ const logger = Logger.getLogger(__filename);
31 31
 var USER_MEDIA_PERMISSION_PROMPT_TIMEOUT = 500;
32 32
 
33 33
 function getLowerResolution(resolution) {
34
-    if(!Resolutions[resolution])        {
34
+    if(!Resolutions[resolution]) {
35 35
         return null;
36 36
     }
37 37
     var order = Resolutions[resolution].order;
@@ -224,7 +224,7 @@ var LibJitsiMeet = {
224 224
             }, USER_MEDIA_PERMISSION_PROMPT_TIMEOUT);
225 225
         }
226 226
 
227
-        if(!window.connectionTimes)            {
227
+        if(!window.connectionTimes) {
228 228
             window.connectionTimes = {};
229 229
         }
230 230
         window.connectionTimes["obtainPermissions.start"] =
@@ -240,7 +240,7 @@ var LibJitsiMeet = {
240 240
                 Statistics.analytics.sendEvent(addDeviceTypeToAnalyticsEvent(
241 241
                     "getUserMedia.success", options), {value: options});
242 242
 
243
-                if(!RTC.options.disableAudioLevels)                    {
243
+                if(!RTC.options.disableAudioLevels) {
244 244
                     for(let i = 0; i < tracks.length; i++) {
245 245
                         const track = tracks[i];
246 246
                         var mStream = track.getOriginalStream();

+ 8
- 8
doc/example/example.js 查看文件

@@ -21,7 +21,7 @@ var isJoined = false;
21 21
  */
22 22
 function onLocalTracks(tracks){
23 23
     localTracks = tracks;
24
-    for(var i = 0; i < localTracks.length; i++)    {
24
+    for(var i = 0; i < localTracks.length; i++) {
25 25
         localTracks[i].addEventListener(JitsiMeetJS.events.track.TRACK_AUDIO_LEVEL_CHANGED,
26 26
             function (audioLevel) {
27 27
                 console.log("Audio Level local: " + audioLevel);
@@ -45,7 +45,7 @@ function onLocalTracks(tracks){
45 45
             $("body").append("<audio autoplay='1' muted='true' id='localAudio" + i + "' />");
46 46
             localTracks[i].attach($("#localAudio" + i)[0]);
47 47
         }
48
-        if(isJoined)            {
48
+        if(isJoined) {
49 49
             room.addTrack(localTracks[i]);
50 50
         }
51 51
     }
@@ -56,11 +56,11 @@ function onLocalTracks(tracks){
56 56
  * @param track JitsiTrack object
57 57
  */
58 58
 function onRemoteTrack(track) {
59
-    if(track.isLocal())        {
59
+    if(track.isLocal()) {
60 60
         return;
61 61
     }
62 62
     var participant = track.getParticipantId();
63
-    if(!remoteTracks[participant])        {
63
+    if(!remoteTracks[participant]) {
64 64
         remoteTracks[participant] = [];
65 65
     }
66 66
     var idx = remoteTracks[participant].push(track);
@@ -95,18 +95,18 @@ function onRemoteTrack(track) {
95 95
 function onConferenceJoined () {
96 96
     console.log("conference joined!");
97 97
     isJoined = true;
98
-    for(var i = 0; i < localTracks.length; i++)        {
98
+    for(var i = 0; i < localTracks.length; i++) {
99 99
         room.addTrack(localTracks[i]);
100 100
     }
101 101
 }
102 102
 
103 103
 function onUserLeft(id) {
104 104
     console.log("user left");
105
-    if(!remoteTracks[id])        {
105
+    if(!remoteTracks[id]) {
106 106
         return;
107 107
     }
108 108
     var tracks = remoteTracks[id];
109
-    for(var i = 0; i< tracks.length; i++)        {
109
+    for(var i = 0; i< tracks.length; i++) {
110 110
         tracks[i].detach($("#" + id + tracks[i].getType()));
111 111
     }
112 112
 }
@@ -173,7 +173,7 @@ function disconnect(){
173 173
 }
174 174
 
175 175
 function unload() {
176
-    for(var i = 0; i < localTracks.length; i++)        {
176
+    for(var i = 0; i < localTracks.length; i++) {
177 177
         localTracks[i].stop();
178 178
     }
179 179
     room.leave();

+ 8
- 8
modules/RTC/DataChannels.js 查看文件

@@ -76,7 +76,7 @@ DataChannels.prototype.onDataChannel = function (event) {
76 76
 
77 77
         try {
78 78
             obj = JSON.parse(data);
79
-        }        catch (e) {
79
+        } catch (e) {
80 80
             GlobalOnErrorHandler.callErrorHandler(e);
81 81
             logger.error(
82 82
                 "Failed to parse data channel message as JSON: ",
@@ -96,7 +96,7 @@ DataChannels.prototype.onDataChannel = function (event) {
96 96
                     dominantSpeakerEndpoint);
97 97
                 self.eventEmitter.emit(RTCEvents.DOMINANT_SPEAKER_CHANGED,
98 98
                   dominantSpeakerEndpoint);
99
-            }            else if ("InLastNChangeEvent" === colibriClass) {
99
+            } else if ("InLastNChangeEvent" === colibriClass) {
100 100
                 var oldValue = obj.oldValue;
101 101
                 var newValue = obj.newValue;
102 102
 
@@ -119,7 +119,7 @@ DataChannels.prototype.onDataChannel = function (event) {
119 119
                 }
120 120
 
121 121
                 self.eventEmitter.emit(RTCEvents.LASTN_CHANGED, oldValue, newValue);
122
-            }            else if ("LastNEndpointsChangeEvent" === colibriClass) {
122
+            } else if ("LastNEndpointsChangeEvent" === colibriClass) {
123 123
                 // The new/latest list of last-n endpoint IDs.
124 124
                 var lastNEndpoints = obj.lastNEndpoints;
125 125
                 // The list of endpoint IDs which are entering the list of
@@ -136,14 +136,14 @@ DataChannels.prototype.onDataChannel = function (event) {
136 136
                 self.eventEmitter.emit(
137 137
                     RTCEvents.ENDPOINT_MESSAGE_RECEIVED, obj.from,
138 138
                     obj.msgPayload);
139
-            }            else if ("EndpointConnectivityStatusChangeEvent" === colibriClass) {
139
+            } else if ("EndpointConnectivityStatusChangeEvent" === colibriClass) {
140 140
                 var endpoint = obj.endpoint;
141 141
                 var isActive = obj.active === "true";
142 142
                 logger.info("Endpoint connection status changed: " + endpoint
143 143
                            + " active ? " + isActive);
144 144
                 self.eventEmitter.emit(RTCEvents.ENDPOINT_CONN_STATUS_CHANGED,
145 145
                     endpoint, isActive);
146
-            }            else {
146
+            } else {
147 147
                 logger.debug("Data channel JSON-formatted message: ", obj);
148 148
                 // The received message appears to be appropriately formatted
149 149
                 // (i.e. is a JSON object which assigns a value to the mandatory
@@ -157,7 +157,7 @@ DataChannels.prototype.onDataChannel = function (event) {
157 157
     dataChannel.onclose = function () {
158 158
         logger.info("The Data Channel closed", dataChannel);
159 159
         var idx = self._dataChannels.indexOf(dataChannel);
160
-        if (idx > -1)            {
160
+        if (idx > -1) {
161 161
             self._dataChannels = self._dataChannels.splice(idx, 1);
162 162
         }
163 163
     };
@@ -235,9 +235,9 @@ DataChannels.prototype._some = function (callback, thisArg) {
235 235
     var dataChannels = this._dataChannels;
236 236
 
237 237
     if (dataChannels && dataChannels.length !== 0) {
238
-        if (thisArg)            {
238
+        if (thisArg) {
239 239
             return dataChannels.some(callback, thisArg);
240
-        }        else            {
240
+        } else {
241 241
             return dataChannels.some(callback);
242 242
         }
243 243
     } else {

+ 13
- 13
modules/RTC/JitsiLocalTrack.js 查看文件

@@ -34,7 +34,7 @@ function JitsiLocalTrack(stream, track, mediaType, videoType, resolution,
34 34
     JitsiTrack.call(this,
35 35
         null /* RTC */, stream, track,
36 36
         function () {
37
-            if(!this.dontFireRemoveEvent)                {
37
+            if(!this.dontFireRemoveEvent) {
38 38
                 this.eventEmitter.emit(
39 39
                     JitsiTrackEvents.LOCAL_TRACK_STOPPED);
40 40
             }
@@ -46,7 +46,7 @@ function JitsiLocalTrack(stream, track, mediaType, videoType, resolution,
46 46
 
47 47
     // FIXME: currently firefox is ignoring our constraints about resolutions
48 48
     // so we do not store it, to avoid wrong reporting of local track resolution
49
-    if (RTCBrowserType.isFirefox())        {
49
+    if (RTCBrowserType.isFirefox()) {
50 50
         this.resolution = null;
51 51
     }
52 52
 
@@ -138,7 +138,7 @@ JitsiLocalTrack.prototype.constructor = JitsiLocalTrack;
138 138
  * @returns {boolean}
139 139
  */
140 140
 JitsiLocalTrack.prototype.isEnded = function () {
141
-    return  this.getTrack().readyState === 'ended' || this._trackEnded;
141
+    return this.getTrack().readyState === 'ended' || this._trackEnded;
142 142
 };
143 143
 
144 144
 /**
@@ -184,7 +184,7 @@ JitsiLocalTrack.prototype._clearNoDataFromSourceMuteResources = function () {
184 184
  */
185 185
 JitsiLocalTrack.prototype._onNoDataFromSourceError = function () {
186 186
     this._clearNoDataFromSourceMuteResources();
187
-    if(this._checkForCameraIssues())        {
187
+    if(this._checkForCameraIssues()) {
188 188
         this._fireNoDataFromSourceEvent();
189 189
     }
190 190
 };
@@ -295,7 +295,7 @@ JitsiLocalTrack.prototype._setMute = function (mute) {
295 295
     if (this.isAudioTrack() ||
296 296
         this.videoType === VideoType.DESKTOP ||
297 297
         RTCBrowserType.isFirefox()) {
298
-        if(this.track)            {
298
+        if(this.track) {
299 299
             this.track.enabled = !mute;
300 300
         }
301 301
     } else {
@@ -319,7 +319,7 @@ JitsiLocalTrack.prototype._setMute = function (mute) {
319 319
                 devices: [ MediaType.VIDEO ],
320 320
                 facingMode: this.getCameraFacingMode()
321 321
             };
322
-            if (this.resolution)                {
322
+            if (this.resolution) {
323 323
                 streamOptions.resolution = this.resolution;
324 324
             }
325 325
 
@@ -479,7 +479,7 @@ JitsiLocalTrack.prototype.dispose = function () {
479 479
  */
480 480
 JitsiLocalTrack.prototype.isMuted = function () {
481 481
     // this.stream will be null when we mute local video on Chrome
482
-    if (!this.stream)        {
482
+    if (!this.stream) {
483 483
         return true;
484 484
     }
485 485
     if (this.isVideoTrack() && !this.isActive()) {
@@ -510,7 +510,7 @@ JitsiLocalTrack.prototype._setConference = function(conference) {
510 510
     // on "attach" call, but for local track we not always have the conference
511 511
     // before attaching. However this may result in duplicated events if they
512 512
     // have been triggered on "attach" already.
513
-    for(var i = 0; i < this.containers.length; i++)    {
513
+    for(var i = 0; i < this.containers.length; i++) {
514 514
         this._maybeFireTrackAttached(this.containers[i]);
515 515
     }
516 516
 };
@@ -523,11 +523,11 @@ JitsiLocalTrack.prototype._setConference = function(conference) {
523 523
  * @returns {string} or {null}
524 524
  */
525 525
 JitsiLocalTrack.prototype.getSSRC = function () {
526
-    if(this.ssrc && this.ssrc.groups && this.ssrc.groups.length)        {
526
+    if(this.ssrc && this.ssrc.groups && this.ssrc.groups.length) {
527 527
         return this.ssrc.groups[0].ssrcs[0];
528
-    }    else if(this.ssrc && this.ssrc.ssrcs && this.ssrc.ssrcs.length)        {
528
+    } else if(this.ssrc && this.ssrc.ssrcs && this.ssrc.ssrcs.length) {
529 529
         return this.ssrc.ssrcs[0];
530
-    }    else        {
530
+    } else {
531 531
         return null;
532 532
     }
533 533
 };
@@ -627,7 +627,7 @@ JitsiLocalTrack.prototype._stopMediaStream = function () {
627 627
  */
628 628
 JitsiLocalTrack.prototype._checkForCameraIssues = function () {
629 629
     if(!this.isVideoTrack() || this.stopStreamInProgress ||
630
-        this.videoType === VideoType.DESKTOP)        {
630
+        this.videoType === VideoType.DESKTOP) {
631 631
         return false;
632 632
     }
633 633
 
@@ -644,7 +644,7 @@ JitsiLocalTrack.prototype._checkForCameraIssues = function () {
644 644
  * @returns {boolean} true if the stream is receiving data and false otherwise.
645 645
  */
646 646
 JitsiLocalTrack.prototype._isReceivingData = function () {
647
-    if(!this.stream)        {
647
+    if(!this.stream) {
648 648
         return false;
649 649
     }
650 650
     // In older version of the spec there is no muted property and

+ 10
- 10
modules/RTC/JitsiRemoteTrack.js 查看文件

@@ -37,7 +37,7 @@ function JitsiRemoteTrack(rtc, conference, ownerEndpointId, stream, track,
37 37
     // increase ttfm values
38 38
     this.hasBeenMuted = muted;
39 39
     // Bind 'onmute' and 'onunmute' event handlers
40
-    if (this.rtc && this.track)        {
40
+    if (this.rtc && this.track) {
41 41
         this._bindMuteHandlers();
42 42
     }
43 43
 }
@@ -77,16 +77,16 @@ JitsiRemoteTrack.prototype._bindMuteHandlers = function() {
77 77
  * @param value the muted status.
78 78
  */
79 79
 JitsiRemoteTrack.prototype.setMute = function (value) {
80
-    if(this.muted === value)        {
80
+    if(this.muted === value) {
81 81
         return;
82 82
     }
83 83
 
84
-    if(value)        {
84
+    if(value) {
85 85
         this.hasBeenMuted = true;
86 86
     }
87 87
 
88 88
     // we can have a fake video stream
89
-    if(this.stream)        {
89
+    if(this.stream) {
90 90
         this.stream.muted = value;
91 91
     }
92 92
 
@@ -132,7 +132,7 @@ JitsiRemoteTrack.prototype.getSSRC = function () {
132 132
  * @param type the new video type("camera", "desktop")
133 133
  */
134 134
 JitsiRemoteTrack.prototype._setVideoType = function (type) {
135
-    if(this.videoType === type)        {
135
+    if(this.videoType === type) {
136 136
         return;
137 137
     }
138 138
     this.videoType = type;
@@ -154,7 +154,7 @@ JitsiRemoteTrack.prototype._playCallback = function () {
154 154
     this.conference.getConnectionTimes()[type + ".ttfm"] = ttfm;
155 155
     console.log("(TIME) TTFM " + type + ":\t", ttfm);
156 156
     var eventName = type +'.ttfm';
157
-    if(this.hasBeenMuted)        {
157
+    if(this.hasBeenMuted) {
158 158
         eventName += '.muted';
159 159
     }
160 160
     Statistics.analytics.sendEvent(eventName, {value: ttfm});
@@ -170,14 +170,14 @@ JitsiRemoteTrack.prototype._playCallback = function () {
170 170
  */
171 171
 JitsiRemoteTrack.prototype._attachTTFMTracker = function (container) {
172 172
     if((ttfmTrackerAudioAttached && this.isAudioTrack())
173
-        || (ttfmTrackerVideoAttached && this.isVideoTrack()))        {
173
+        || (ttfmTrackerVideoAttached && this.isVideoTrack())) {
174 174
         return;
175 175
     }
176 176
 
177
-    if (this.isAudioTrack())        {
177
+    if (this.isAudioTrack()) {
178 178
         ttfmTrackerAudioAttached = true;
179 179
     }
180
-    if (this.isVideoTrack())        {
180
+    if (this.isVideoTrack()) {
181 181
         ttfmTrackerVideoAttached = true;
182 182
     }
183 183
 
@@ -188,7 +188,7 @@ JitsiRemoteTrack.prototype._attachTTFMTracker = function (container) {
188 188
 
189 189
         // FIXME: this is not working for IE11
190 190
         AdapterJS.addEvent(container, 'play', this._playCallback.bind(this));
191
-    }    else {
191
+    } else {
192 192
         container.addEventListener("canplay", this._playCallback.bind(this));
193 193
     }
194 194
 };

+ 10
- 10
modules/RTC/JitsiTrack.js 查看文件

@@ -26,7 +26,7 @@ var trackHandler2Prop = {
26 26
 function implementOnEndedHandling(jitsiTrack) {
27 27
     var stream = jitsiTrack.getOriginalStream();
28 28
 
29
-    if(!stream)        {
29
+    if(!stream) {
30 30
         return;
31 31
     }
32 32
 
@@ -46,9 +46,9 @@ function implementOnEndedHandling(jitsiTrack) {
46 46
  */
47 47
 function addMediaStreamInactiveHandler(mediaStream, handler) {
48 48
     // Temasys will use onended
49
-    if(typeof mediaStream.active !== "undefined")        {
49
+    if(typeof mediaStream.active !== "undefined") {
50 50
         mediaStream.oninactive = handler;
51
-    }    else        {
51
+    } else {
52 52
         mediaStream.onended = handler;
53 53
     }
54 54
 }
@@ -102,7 +102,7 @@ function JitsiTrack(conference, stream, track, streamInactiveHandler, trackMedia
102 102
  */
103 103
 JitsiTrack.prototype._setHandler = function (type, handler) {
104 104
     this.handlers[type] = handler;
105
-    if(!this.stream)        {
105
+    if(!this.stream) {
106 106
         return;
107 107
     }
108 108
 
@@ -317,9 +317,9 @@ JitsiTrack.prototype.isScreenSharing = function() {
317 317
  * @returns {string|null} id of the track or null if this is fake track.
318 318
  */
319 319
 JitsiTrack.prototype.getId = function () {
320
-    if(this.stream)        {
320
+    if(this.stream) {
321 321
         return RTCUtils.getStreamID(this.stream);
322
-    }    else        {
322
+    } else {
323 323
         return null;
324 324
     }
325 325
 };
@@ -331,9 +331,9 @@ JitsiTrack.prototype.getId = function () {
331 331
  * @returns {boolean} whether MediaStream is active.
332 332
  */
333 333
 JitsiTrack.prototype.isActive = function () {
334
-    if(typeof this.stream.active !== "undefined")        {
334
+    if(typeof this.stream.active !== "undefined") {
335 335
         return this.stream.active;
336
-    }    else        {
336
+    } else {
337 337
         return true;
338 338
     }
339 339
 };
@@ -345,7 +345,7 @@ JitsiTrack.prototype.isActive = function () {
345 345
  * @param handler handler for the event.
346 346
  */
347 347
 JitsiTrack.prototype.on = function (eventId, handler) {
348
-    if(this.eventEmitter)        {
348
+    if(this.eventEmitter) {
349 349
         this.eventEmitter.on(eventId, handler);
350 350
     }
351 351
 };
@@ -356,7 +356,7 @@ JitsiTrack.prototype.on = function (eventId, handler) {
356 356
  * @param [handler] optional, the specific handler to unbind
357 357
  */
358 358
 JitsiTrack.prototype.off = function (eventId, handler) {
359
-    if(this.eventEmitter)        {
359
+    if(this.eventEmitter) {
360 360
         this.eventEmitter.removeListener(eventId, handler);
361 361
     }
362 362
 };

+ 5
- 5
modules/RTC/RTC.js 查看文件

@@ -164,7 +164,7 @@ export default class RTC extends Listenable {
164 164
     selectEndpoint (id) {
165 165
         // cache the value if channel is missing, till we open it
166 166
         this.selectedEndpoint = id;
167
-        if(this.dataChannels && this.dataChannelsOpen)            {
167
+        if(this.dataChannels && this.dataChannelsOpen) {
168 168
             this.dataChannels.sendSelectedEndpointMessage(id);
169 169
         }
170 170
     }
@@ -253,7 +253,7 @@ export default class RTC extends Listenable {
253 253
     }
254 254
 
255 255
     addLocalTrack (track) {
256
-        if (!track)            {
256
+        if (!track) {
257 257
             throw new Error('track must not be null nor undefined');
258 258
         }
259 259
 
@@ -334,9 +334,9 @@ export default class RTC extends Listenable {
334 334
      * @returns {JitsiRemoteTrack|null}
335 335
      */
336 336
     getRemoteTrackByType (type, resource) {
337
-        if (this.remoteTracks[resource])            {
337
+        if (this.remoteTracks[resource]) {
338 338
             return this.remoteTracks[resource][type];
339
-        }        else            {
339
+        } else {
340 340
             return null;
341 341
         }
342 342
     }
@@ -637,7 +637,7 @@ export default class RTC extends Listenable {
637 637
     dispose () { }
638 638
 
639 639
     setAudioLevel (resource, audioLevel) {
640
-        if(!resource)            {
640
+        if(!resource) {
641 641
             return;
642 642
         }
643 643
         var audioTrack = this.getRemoteAudioTrack(resource);

+ 1
- 1
modules/RTC/RTCBrowserType.js 查看文件

@@ -335,7 +335,7 @@ function detectBrowser() {
335 335
     // Try all browser detectors
336 336
     for (var i = 0; i < detectors.length; i++) {
337 337
         version = detectors[i]();
338
-        if (version)            {
338
+        if (version) {
339 339
             return version;
340 340
         }
341 341
     }

+ 7
- 7
modules/RTC/RTCUtils.js 查看文件

@@ -107,7 +107,7 @@ function setResolutionConstraints(constraints, resolution) {
107 107
     if (Resolutions[resolution]) {
108 108
         constraints.video.mandatory.minWidth = Resolutions[resolution].width;
109 109
         constraints.video.mandatory.minHeight = Resolutions[resolution].height;
110
-    }    else if (isAndroid) {
110
+    } else if (isAndroid) {
111 111
         // FIXME can't remember if the purpose of this was to always request
112 112
         //       low resolution on Android ? if yes it should be moved up front
113 113
         constraints.video.mandatory.minWidth = 320;
@@ -115,11 +115,11 @@ function setResolutionConstraints(constraints, resolution) {
115 115
         constraints.video.mandatory.maxFrameRate = 15;
116 116
     }
117 117
 
118
-    if (constraints.video.mandatory.minWidth)        {
118
+    if (constraints.video.mandatory.minWidth) {
119 119
         constraints.video.mandatory.maxWidth =
120 120
             constraints.video.mandatory.minWidth;
121 121
     }
122
-    if (constraints.video.mandatory.minHeight)        {
122
+    if (constraints.video.mandatory.minHeight) {
123 123
         constraints.video.mandatory.maxHeight =
124 124
             constraints.video.mandatory.minHeight;
125 125
     }
@@ -294,7 +294,7 @@ function getConstraints(um, options) {
294 294
     // we turn audio for both audio and video tracks, the fake audio & video seems to work
295 295
     // only when enabled in one getUserMedia call, we cannot get fake audio separate by fake video
296 296
     // this later can be a problem with some of the tests
297
-    if(RTCBrowserType.isFirefox() && options.firefox_fake_device)    {
297
+    if(RTCBrowserType.isFirefox() && options.firefox_fake_device) {
298 298
         // seems to be fixed now, removing this experimental fix, as having
299 299
         // multiple audio tracks brake the tests
300 300
         //constraints.audio = true;
@@ -771,7 +771,7 @@ class RTCUtils extends Listenable {
771 771
                     // https://github.com/webrtc/samples/issues/302
772 772
                     if (element) {
773 773
                         defaultSetVideoSrc(element, stream);
774
-                        if (stream)                            {
774
+                        if (stream) {
775 775
                             element.play();
776 776
                         }
777 777
                     }
@@ -1054,7 +1054,7 @@ class RTCUtils extends Listenable {
1054 1054
                             var videoTracksReceived = !!stream.getVideoTracks().length;
1055 1055
 
1056 1056
                             if((audioDeviceRequested && !audioTracksReceived) ||
1057
-                                (videoDeviceRequested && !videoTracksReceived))                            {
1057
+                                (videoDeviceRequested && !videoTracksReceived)) {
1058 1058
                                 self.stopMediaStream(stream);
1059 1059
 
1060 1060
                                 // We are getting here in case if we requested
@@ -1144,7 +1144,7 @@ class RTCUtils extends Listenable {
1144 1144
     }
1145 1145
 
1146 1146
     _isDeviceListAvailable () {
1147
-        if (!rtcReady)            {
1147
+        if (!rtcReady) {
1148 1148
             throw new Error("WebRTC not ready yet");
1149 1149
         }
1150 1150
         var isEnumerateDevicesAvailable

+ 7
- 7
modules/RTC/ScreenObtainer.js 查看文件

@@ -73,7 +73,7 @@ var ScreenObtainer = {
73 73
         this.options = options = options || {};
74 74
         gumFunction = gum;
75 75
 
76
-        if (RTCBrowserType.isFirefox())            {
76
+        if (RTCBrowserType.isFirefox()) {
77 77
             initFirefoxExtensionDetection(options);
78 78
         }
79 79
 
@@ -207,7 +207,7 @@ var ScreenObtainer = {
207 207
         if (firefoxExtInstalled === null) {
208 208
             window.setTimeout(
209 209
                 () => {
210
-                    if (firefoxExtInstalled === null)                        {
210
+                    if (firefoxExtInstalled === null) {
211 211
                         firefoxExtInstalled = false;
212 212
                     }
213 213
                     this.obtainScreenOnFirefox(callback, errorCallback);
@@ -354,10 +354,10 @@ function isUpdateRequired(minVersion, extVersion) {
354 354
             var n1 = 0,
355 355
                 n2 = 0;
356 356
 
357
-            if (i < s1.length)                {
357
+            if (i < s1.length) {
358 358
                 n1 = parseInt(s1[i]);
359 359
             }
360
-            if (i < s2.length)                {
360
+            if (i < s2.length) {
361 361
                 n2 = parseInt(s2[i]);
362 362
             }
363 363
 
@@ -371,7 +371,7 @@ function isUpdateRequired(minVersion, extVersion) {
371 371
         // will happen if both versions have identical numbers in
372 372
         // their components (even if one of them is longer, has more components)
373 373
         return false;
374
-    }    catch (e) {
374
+    } catch (e) {
375 375
         GlobalOnErrorHandler.callErrorHandler(e);
376 376
         logger.error("Failed to parse extension version", e);
377 377
         return true;
@@ -512,7 +512,7 @@ function onGetStreamResponse(response, onSuccess, onFailure) {
512 512
         // As noted in Chrome Desktop Capture API:
513 513
         // If user didn't select any source (i.e. canceled the prompt)
514 514
         // then the callback is called with an empty streamId.
515
-        if(response.streamId === "")        {
515
+        if(response.streamId === "") {
516 516
             onFailure(new JitsiTrackError(
517 517
                 JitsiTrackErrors.CHROME_EXTENSION_USER_CANCELED));
518 518
             return;
@@ -533,7 +533,7 @@ function initFirefoxExtensionDetection(options) {
533 533
     if (options.desktopSharingFirefoxDisabled) {
534 534
         return;
535 535
     }
536
-    if (firefoxExtInstalled === false || firefoxExtInstalled === true)        {
536
+    if (firefoxExtInstalled === false || firefoxExtInstalled === true) {
537 537
         return;
538 538
     }
539 539
     if (!options.desktopSharingFirefoxExtId) {

+ 2
- 2
modules/RTC/TraceablePeerConnection.js 查看文件

@@ -606,7 +606,7 @@ Object.keys(getters).forEach(function (prop) {
606 606
 
607 607
 TraceablePeerConnection.prototype.addStream = function (stream, ssrcInfo) {
608 608
     this.trace('addStream', stream ? stream.id : "null");
609
-    if (stream)        {
609
+    if (stream) {
610 610
         this.peerconnection.addStream(stream);
611 611
     }
612 612
     if (ssrcInfo && ssrcInfo.type === "addMuted") {
@@ -913,7 +913,7 @@ TraceablePeerConnection.prototype.getStats = function(callback, errback) {
913 913
             || RTCBrowserType.isTemasysPluginUsed()
914 914
             || RTCBrowserType.isReactNative()) {
915 915
         // ignore for now...
916
-        if(!errback)            {
916
+        if(!errback) {
917 917
             errback = function () {};
918 918
         }
919 919
         this.peerconnection.getStats(null, callback, errback);

+ 3
- 3
modules/TalkMutedDetection.js 查看文件

@@ -59,7 +59,7 @@ export default class TalkMutedDetection {
59 59
     _audioLevel(ssrc, audioLevel, isLocal) {
60 60
         // We are interested in the local audio stream only and if event is not
61 61
         // sent yet.
62
-        if (!isLocal || !this.audioTrack || this._eventFired)            {
62
+        if (!isLocal || !this.audioTrack || this._eventFired) {
63 63
             return;
64 64
         }
65 65
 
@@ -92,7 +92,7 @@ export default class TalkMutedDetection {
92 92
      * @private
93 93
      */
94 94
     _trackAdded(track) {
95
-        if (this._isLocalAudioTrack(track))            {
95
+        if (this._isLocalAudioTrack(track)) {
96 96
             this.audioTrack = track;
97 97
         }
98 98
     }
@@ -106,7 +106,7 @@ export default class TalkMutedDetection {
106 106
      * @private
107 107
      */
108 108
     _trackMuteChanged(track) {
109
-        if (this._isLocalAudioTrack(track) && track.isMuted())            {
109
+        if (this._isLocalAudioTrack(track) && track.isMuted()) {
110 110
             this._eventFired = false;
111 111
         }
112 112
     }

+ 8
- 8
modules/connectivity/ConnectionQuality.js 查看文件

@@ -21,11 +21,11 @@ const STATS_MESSAGE_TYPE = "stats";
21 21
  */
22 22
 const kSimulcastFormats = [
23 23
     { width: 1920, height: 1080, layers:3, max: 5000, target: 4000, min: 800 },
24
-    { width: 1280, height: 720,  layers:3, max: 2500, target: 2500, min: 600 },
25
-    { width: 960,  height: 540,  layers:3, max: 900,  target: 900, min: 450 },
26
-    { width: 640,  height: 360,  layers:2, max: 700,  target: 500, min: 150 },
27
-    { width: 480,  height: 270,  layers:2, max: 450,  target: 350, min: 150 },
28
-    { width: 320,  height: 180,  layers:1, max: 200,  target: 150, min: 30 }
24
+    { width: 1280, height: 720, layers:3, max: 2500, target: 2500, min: 600 },
25
+    { width: 960, height: 540, layers:3, max: 900, target: 900, min: 450 },
26
+    { width: 640, height: 360, layers:2, max: 700, target: 500, min: 150 },
27
+    { width: 480, height: 270, layers:2, max: 450, target: 350, min: 150 },
28
+    { width: 320, height: 180, layers:1, max: 200, target: 150, min: 30 }
29 29
 ];
30 30
 
31 31
 /**
@@ -74,7 +74,7 @@ function getTarget(simulcast, resolution, millisSinceStart) {
74 74
         if (pixels <= 320 * 240) {
75 75
             target = 600;
76 76
         } else if (pixels <= 640 * 480) {
77
-            target =  1700;
77
+            target = 1700;
78 78
         } else if (pixels <= 960 * 540) {
79 79
             target = 2000;
80 80
         } else {
@@ -218,7 +218,7 @@ export default class ConnectionQuality {
218 218
         conference.on(
219 219
             ConferenceEvents.TRACK_ADDED,
220 220
             (track) => {
221
-                if (track.isVideoTrack() && !track.isMuted())                {
221
+                if (track.isVideoTrack() && !track.isMuted()) {
222 222
                     this._maybeUpdateUnmuteTime();
223 223
                 }
224 224
             });
@@ -317,7 +317,7 @@ export default class ConnectionQuality {
317 317
         }
318 318
 
319 319
         // Make sure that the quality doesn't climb quickly
320
-        if (this._lastConnectionQualityUpdate > 0)        {
320
+        if (this._lastConnectionQualityUpdate > 0) {
321 321
             const maxIncreasePerSecond = 2;
322 322
             const prevConnectionQuality = this._localStats.connectionQuality;
323 323
             const diffSeconds

+ 3
- 3
modules/statistics/CallStats.js 查看文件

@@ -211,7 +211,7 @@ CallStats.feedbackEnabled = false;
211 211
  */
212 212
 CallStats._checkInitialize = function () {
213 213
     if (CallStats.initialized || !CallStats.initializeFailed
214
-        || !callStats || CallStats.initializeInProgress)        {
214
+        || !callStats || CallStats.initializeInProgress) {
215 215
         return;
216 216
     }
217 217
 
@@ -236,7 +236,7 @@ var reportType = {
236 236
 };
237 237
 
238 238
 CallStats.prototype.pcCallback = _try_catch(function (err, msg) {
239
-    if (callStats && err !== 'success')        {
239
+    if (callStats && err !== 'success') {
240 240
         logger.error("Monitoring status: "+ err + " msg: " + msg);
241 241
     }
242 242
 });
@@ -279,7 +279,7 @@ function (ssrc, isLocal, usageLabel, containerId) {
279 279
                 ssrc,
280 280
                 usageLabel,
281 281
                 containerId);
282
-        }        else {
282
+        } else {
283 283
             CallStats.reportsQueue.push({
284 284
                 type: reportType.MST_WITH_USERID,
285 285
                 data: {

+ 4
- 4
modules/statistics/LocalStatsCollector.js 查看文件

@@ -46,7 +46,7 @@ function timeDomainDataToAudioLevel(samples) {
46 46
     var length = samples.length;
47 47
 
48 48
     for (var i = 0; i < length; i++) {
49
-        if (maxVolume < samples[i])            {
49
+        if (maxVolume < samples[i]) {
50 50
             maxVolume = samples[i];
51 51
         }
52 52
     }
@@ -65,9 +65,9 @@ function animateLevel(newLevel, lastLevel) {
65 65
     var diff = lastLevel - newLevel;
66 66
     if(diff > 0.2) {
67 67
         value = lastLevel - 0.2;
68
-    }    else if(diff < -0.4) {
68
+    } else if(diff < -0.4) {
69 69
         value = lastLevel + 0.4;
70
-    }    else {
70
+    } else {
71 71
         value = newLevel;
72 72
     }
73 73
 
@@ -96,7 +96,7 @@ function LocalStatsCollector(stream, interval, callback) {
96 96
  */
97 97
 LocalStatsCollector.prototype.start = function () {
98 98
     if (!context ||
99
-        RTCBrowserType.isTemasysPluginUsed())        {
99
+        RTCBrowserType.isTemasysPluginUsed()) {
100 100
         return;
101 101
     }
102 102
     context.resume();

+ 18
- 18
modules/statistics/RTPStatsCollector.js 查看文件

@@ -64,7 +64,7 @@ KEYS_BY_BROWSER_TYPE[RTCBrowserType.RTC_BROWSER_REACT_NATIVE] =
64 64
  * @returns {number} packet loss percent
65 65
  */
66 66
 function calculatePacketLoss(lostPackets, totalPackets) {
67
-    if(!totalPackets || totalPackets <= 0 || !lostPackets || lostPackets <= 0)        {
67
+    if(!totalPackets || totalPackets <= 0 || !lostPackets || lostPackets <= 0) {
68 68
         return 0;
69 69
     }
70 70
     return Math.round((lostPackets/totalPackets)*100);
@@ -180,7 +180,7 @@ function StatsCollector(
180 180
      */
181 181
     this._browserType = RTCBrowserType.getBrowserType();
182 182
     var keys = KEYS_BY_BROWSER_TYPE[this._browserType];
183
-    if (!keys)        {
183
+    if (!keys) {
184 184
         throw "The browser type '" + this._browserType + "' isn't supported!";
185 185
     }
186 186
     /**
@@ -252,7 +252,7 @@ StatsCollector.prototype.start = function (startAudioLevelStats) {
252 252
                         if (!report || !report.result ||
253 253
                             typeof report.result != 'function') {
254 254
                             results = report;
255
-                        }                        else {
255
+                        } else {
256 256
                             results = report.result();
257 257
                         }
258 258
                         self.currentAudioLevelsReport = results;
@@ -278,14 +278,14 @@ StatsCollector.prototype.start = function (startAudioLevelStats) {
278 278
                             typeof report.result != 'function') {
279 279
                             //firefox
280 280
                             results = report;
281
-                        }                        else {
281
+                        } else {
282 282
                             //chrome
283 283
                             results = report.result();
284 284
                         }
285 285
                         self.currentStatsReport = results;
286 286
                         try {
287 287
                             self.processStatsReport();
288
-                        }                        catch (e) {
288
+                        } catch (e) {
289 289
                             GlobalOnErrorHandler.callErrorHandler(e);
290 290
                             logger.error("Unsupported key:" + e, e);
291 291
                         }
@@ -314,9 +314,9 @@ StatsCollector.prototype._defineGetStatValueMethod = function (keys) {
314 314
     // RTCPeerConnection#getStats.
315 315
     var keyFromName = function (name) {
316 316
         var key = keys[name];
317
-        if (key)            {
317
+        if (key) {
318 318
             return key;
319
-        }        else            {
319
+        } else {
320 320
             throw "The property '" + name + "' isn't supported!";
321 321
         }
322 322
     };
@@ -406,17 +406,17 @@ StatsCollector.prototype.processStatsReport = function () {
406 406
                     "upload": Math.round(sendBandwidth / 1000)
407 407
                 };
408 408
             }
409
-        }        catch(e){/*not supported*/}
409
+        } catch(e){/*not supported*/}
410 410
 
411
-        if(now.type == 'googCandidatePair')        {
411
+        if(now.type == 'googCandidatePair') {
412 412
             var ip, type, localip, active;
413 413
             try {
414 414
                 ip = getStatValue(now, 'remoteAddress');
415 415
                 type = getStatValue(now, "transportType");
416 416
                 localip = getStatValue(now, "localAddress");
417 417
                 active = getStatValue(now, "activeConnection");
418
-            }            catch(e){/*not supported*/}
419
-            if(!ip || !type || !localip || active != "true")                {
418
+            } catch(e){/*not supported*/}
419
+            if(!ip || !type || !localip || active != "true") {
420 420
                 continue;
421 421
             }
422 422
             // Save the address unless it has been saved already.
@@ -433,7 +433,7 @@ StatsCollector.prototype.processStatsReport = function () {
433 433
         }
434 434
 
435 435
         if(now.type == "candidatepair") {
436
-            if(now.state == "succeeded")                {
436
+            if(now.state == "succeeded") {
437 437
                 continue;
438 438
             }
439 439
 
@@ -473,7 +473,7 @@ StatsCollector.prototype.processStatsReport = function () {
473 473
                 continue;
474 474
             }
475 475
         }
476
-        if (!packetsNow || packetsNow < 0)            {
476
+        if (!packetsNow || packetsNow < 0) {
477 477
             packetsNow = 0;
478 478
         }
479 479
 
@@ -531,12 +531,12 @@ StatsCollector.prototype.processStatsReport = function () {
531 531
                 (width = getStatValue(now, "googFrameWidthReceived"))) {
532 532
                 resolution.height = height;
533 533
                 resolution.width = width;
534
-            }            else if ((height = getStatValue(now, "googFrameHeightSent")) &&
534
+            } else if ((height = getStatValue(now, "googFrameHeightSent")) &&
535 535
                 (width = getStatValue(now, "googFrameWidthSent"))) {
536 536
                 resolution.height = height;
537 537
                 resolution.width = width;
538 538
             }
539
-        }        catch(e){/*not supported*/}
539
+        } catch(e){/*not supported*/}
540 540
 
541 541
         if (resolution.height && resolution.width) {
542 542
             ssrcStats.setResolution(resolution);
@@ -615,7 +615,7 @@ StatsCollector.prototype.processAudioLevelReport = function () {
615 615
     for (var idx in this.currentAudioLevelsReport) {
616 616
         var now = this.currentAudioLevelsReport[idx];
617 617
 
618
-        if (now.type != 'ssrc')            {
618
+        if (now.type != 'ssrc') {
619 619
             continue;
620 620
         }
621 621
 
@@ -627,7 +627,7 @@ StatsCollector.prototype.processAudioLevelReport = function () {
627 627
         }
628 628
 
629 629
         if (!ssrc) {
630
-            if ((Date.now() - now.timestamp) < 3000)                {
630
+            if ((Date.now() - now.timestamp) < 3000) {
631 631
                 logger.warn("No ssrc: ");
632 632
             }
633 633
             continue;
@@ -638,7 +638,7 @@ StatsCollector.prototype.processAudioLevelReport = function () {
638 638
             var audioLevel
639 639
                 = getStatValue(now, 'audioInputLevel')
640 640
                     || getStatValue(now, 'audioOutputLevel');
641
-        }        catch(e) {/*not supported*/
641
+        } catch(e) {/*not supported*/
642 642
             logger.warn("Audio Levels are not available in the statistics.");
643 643
             clearInterval(this.audioLevelsIntervalId);
644 644
             return;

+ 18
- 18
modules/statistics/statistics.js 查看文件

@@ -89,7 +89,7 @@ function Statistics(xmpp, options) {
89 89
             // of callstats.io may be disabled because of globally-disallowed
90 90
             // requests to any third parties.
91 91
             && (Statistics.disableThirdPartyRequests !== true);
92
-    if(this.callStatsIntegrationEnabled)        {
92
+    if(this.callStatsIntegrationEnabled) {
93 93
         loadCallStatsAPI(this.options.callStatsCustomScriptUrl);
94 94
     }
95 95
     this.callStats = null;
@@ -125,7 +125,7 @@ Statistics.prototype.startRemoteStats = function (peerconnection) {
125 125
 Statistics.localStats = [];
126 126
 
127 127
 Statistics.startLocalStats = function (stream, callback) {
128
-    if(!Statistics.audioLevelsEnabled)        {
128
+    if(!Statistics.audioLevelsEnabled) {
129 129
         return;
130 130
     }
131 131
     var localStats = new LocalStats(stream, Statistics.audioLevelsInterval,
@@ -135,14 +135,14 @@ Statistics.startLocalStats = function (stream, callback) {
135 135
 };
136 136
 
137 137
 Statistics.prototype.addAudioLevelListener = function(listener) {
138
-    if(!Statistics.audioLevelsEnabled)        {
138
+    if(!Statistics.audioLevelsEnabled) {
139 139
         return;
140 140
     }
141 141
     this.eventEmitter.on(StatisticsEvents.AUDIO_LEVEL, listener);
142 142
 };
143 143
 
144 144
 Statistics.prototype.removeAudioLevelListener = function(listener) {
145
-    if(!Statistics.audioLevelsEnabled)        {
145
+    if(!Statistics.audioLevelsEnabled) {
146 146
         return;
147 147
     }
148 148
     this.eventEmitter.removeListener(StatisticsEvents.AUDIO_LEVEL, listener);
@@ -180,17 +180,17 @@ Statistics.prototype.dispose = function () {
180 180
     }
181 181
     this.stopCallStats();
182 182
     this.stopRemoteStats();
183
-    if(this.eventEmitter)        {
183
+    if(this.eventEmitter) {
184 184
         this.eventEmitter.removeAllListeners();
185 185
     }
186 186
 };
187 187
 
188 188
 Statistics.stopLocalStats = function (stream) {
189
-    if(!Statistics.audioLevelsEnabled)        {
189
+    if(!Statistics.audioLevelsEnabled) {
190 190
         return;
191 191
     }
192 192
 
193
-    for(var i = 0; i < Statistics.localStats.length; i++)        {
193
+    for(var i = 0; i < Statistics.localStats.length; i++) {
194 194
         if(Statistics.localStats[i].stream === stream){
195 195
             var localStats = Statistics.localStats.splice(i, 1);
196 196
             localStats[0].stop();
@@ -230,7 +230,7 @@ Statistics.prototype.startCallStats = function (session) {
230 230
 Statistics.prototype.stopCallStats = function () {
231 231
     if(this.callStatsStarted) {
232 232
         var index = Statistics.callsStatsInstances.indexOf(this.callstats);
233
-        if(index > -1)            {
233
+        if(index > -1) {
234 234
             Statistics.callsStatsInstances.splice(index, 1);
235 235
         }
236 236
         // The next line is commented because we need to be able to send
@@ -257,7 +257,7 @@ Statistics.prototype.isCallstatsEnabled = function () {
257 257
  * @param {RTCPeerConnection} pc connection on which failure occured.
258 258
  */
259 259
 Statistics.prototype.sendIceConnectionFailedEvent = function (pc) {
260
-    if(this.callstats)        {
260
+    if(this.callstats) {
261 261
         this.callstats.sendIceConnectionFailedEvent(pc, this.callstats);
262 262
     }
263 263
     Statistics.analytics.sendEvent('connection.ice_failed');
@@ -269,7 +269,7 @@ Statistics.prototype.sendIceConnectionFailedEvent = function (pc) {
269 269
  * @param type {String} "audio"/"video"
270 270
  */
271 271
 Statistics.prototype.sendMuteEvent = function (muted, type) {
272
-    if(this.callstats)        {
272
+    if(this.callstats) {
273 273
         CallStats.sendMuteEvent(muted, type, this.callstats);
274 274
     }
275 275
 };
@@ -280,7 +280,7 @@ Statistics.prototype.sendMuteEvent = function (muted, type) {
280 280
  * false for not stopping
281 281
  */
282 282
 Statistics.prototype.sendScreenSharingEvent = function (start) {
283
-    if(this.callstats)        {
283
+    if(this.callstats) {
284 284
         CallStats.sendScreenSharingEvent(start, this.callstats);
285 285
     }
286 286
 };
@@ -290,7 +290,7 @@ Statistics.prototype.sendScreenSharingEvent = function (start) {
290 290
  * conference.
291 291
  */
292 292
 Statistics.prototype.sendDominantSpeakerEvent = function () {
293
-    if(this.callstats)        {
293
+    if(this.callstats) {
294 294
         CallStats.sendDominantSpeakerEvent(this.callstats);
295 295
     }
296 296
 };
@@ -360,7 +360,7 @@ Statistics.sendGetUserMediaFailed = function (e) {
360 360
  * @param {RTCPeerConnection} pc connection on which failure occured.
361 361
  */
362 362
 Statistics.prototype.sendCreateOfferFailed = function (e, pc) {
363
-    if(this.callstats)        {
363
+    if(this.callstats) {
364 364
         CallStats.sendCreateOfferFailed(e, pc, this.callstats);
365 365
     }
366 366
 };
@@ -372,7 +372,7 @@ Statistics.prototype.sendCreateOfferFailed = function (e, pc) {
372 372
  * @param {RTCPeerConnection} pc connection on which failure occured.
373 373
  */
374 374
 Statistics.prototype.sendCreateAnswerFailed = function (e, pc) {
375
-    if(this.callstats)        {
375
+    if(this.callstats) {
376 376
         CallStats.sendCreateAnswerFailed(e, pc, this.callstats);
377 377
     }
378 378
 };
@@ -384,7 +384,7 @@ Statistics.prototype.sendCreateAnswerFailed = function (e, pc) {
384 384
  * @param {RTCPeerConnection} pc connection on which failure occured.
385 385
  */
386 386
 Statistics.prototype.sendSetLocalDescFailed = function (e, pc) {
387
-    if(this.callstats)        {
387
+    if(this.callstats) {
388 388
         CallStats.sendSetLocalDescFailed(e, pc, this.callstats);
389 389
     }
390 390
 };
@@ -396,7 +396,7 @@ Statistics.prototype.sendSetLocalDescFailed = function (e, pc) {
396 396
  * @param {RTCPeerConnection} pc connection on which failure occured.
397 397
  */
398 398
 Statistics.prototype.sendSetRemoteDescFailed = function (e, pc) {
399
-    if(this.callstats)        {
399
+    if(this.callstats) {
400 400
         CallStats.sendSetRemoteDescFailed(e, pc, this.callstats);
401 401
     }
402 402
 };
@@ -408,7 +408,7 @@ Statistics.prototype.sendSetRemoteDescFailed = function (e, pc) {
408 408
  * @param {RTCPeerConnection} pc connection on which failure occured.
409 409
  */
410 410
 Statistics.prototype.sendAddIceCandidateFailed = function (e, pc) {
411
-    if(this.callstats)        {
411
+    if(this.callstats) {
412 412
         CallStats.sendAddIceCandidateFailed(e, pc, this.callstats);
413 413
     }
414 414
 };
@@ -435,7 +435,7 @@ Statistics.sendLog = function (m) {
435 435
  * @param detailed detailed feedback from the user. Not yet used
436 436
  */
437 437
 Statistics.prototype.sendFeedback = function(overall, detailed) {
438
-    if(this.callstats)        {
438
+    if(this.callstats) {
439 439
         this.callstats.sendFeedback(overall, detailed);
440 440
     }
441 441
     Statistics.analytics.sendEvent("feedback.rating",

+ 7
- 7
modules/transcription/audioRecorder.js 查看文件

@@ -6,7 +6,7 @@ var RecordingResult = require("./recordingResult");
6 6
  * Possible audio formats MIME types
7 7
  */
8 8
 var AUDIO_WEBM = "audio/webm";    // Supported in chrome
9
-var AUDIO_OGG  = "audio/ogg";     // Supported in firefox
9
+var AUDIO_OGG = "audio/ogg";     // Supported in firefox
10 10
 
11 11
 /**
12 12
  * A TrackRecorder object holds all the information needed for recording a
@@ -91,9 +91,9 @@ function instantiateTrackRecorder(track) {
91 91
 function determineCorrectFileType() {
92 92
     if(MediaRecorder.isTypeSupported(AUDIO_WEBM)) {
93 93
         return AUDIO_WEBM;
94
-    }    else if(MediaRecorder.isTypeSupported(AUDIO_OGG)) {
94
+    } else if(MediaRecorder.isTypeSupported(AUDIO_OGG)) {
95 95
         return AUDIO_OGG;
96
-    }    else {
96
+    } else {
97 97
         throw new Error("unable to create a MediaRecorder with the" +
98 98
             "right mimetype!");
99 99
     }
@@ -167,7 +167,7 @@ audioRecorder.prototype.removeTrack = function(track){
167 167
             var recorderToRemove = array[i];
168 168
             if(this.isRecording){
169 169
                 stopRecorder(recorderToRemove);
170
-            }            else {
170
+            } else {
171 171
                 //remove the TrackRecorder from the array
172 172
                 array.splice(i, 1);
173 173
             }
@@ -188,7 +188,7 @@ audioRecorder.prototype.updateNames = function(){
188 188
     this.recorders.forEach(function(trackRecorder){
189 189
         if(trackRecorder.track.isLocal()){
190 190
             trackRecorder.name = "the transcriber";
191
-        }        else {
191
+        } else {
192 192
             var id = trackRecorder.track.getParticipantId();
193 193
             var participant = conference.getParticipantById(id);
194 194
             var newName = participant.getDisplayName();
@@ -292,9 +292,9 @@ function createEmptyStream() {
292 292
     // Firefox supports the MediaStream object, Chrome webkitMediaStream
293 293
     if(typeof MediaStream !== 'undefined') {
294 294
         return new MediaStream();
295
-    }    else if(typeof webkitMediaStream !== 'undefined') {
295
+    } else if(typeof webkitMediaStream !== 'undefined') {
296 296
         return new webkitMediaStream(); // eslint-disable-line new-cap
297
-    }    else {
297
+    } else {
298 298
         throw new Error("cannot create a clean mediaStream");
299 299
     }
300 300
 }

+ 3
- 3
modules/transcription/transcriber.js 查看文件

@@ -21,7 +21,7 @@ var transcriber = function() {
21 21
     //the object which can record all audio in the conference
22 22
     this.audioRecorder = new AudioRecorder();
23 23
     //this object can send the recorder audio to a speech-to-text service
24
-    this.transcriptionService =  new SphinxService();
24
+    this.transcriptionService = new SphinxService();
25 25
     //holds a counter to keep track if merging can start
26 26
     this.counter = null;
27 27
     //holds the date when transcription started which makes it possible
@@ -31,7 +31,7 @@ var transcriber = function() {
31 31
     this.transcription = null;
32 32
     //this will be a method which will be called once the transcription is done
33 33
     //with the transcription as parameter
34
-    this.callback =  null;
34
+    this.callback = null;
35 35
     //stores all the retrieved speech-to-text results to merge together
36 36
     //this value will store an Array<Word> object
37 37
     this.results = [];
@@ -255,7 +255,7 @@ var hasPopulatedArrays = function(twoDimensionalArray){
255 255
 var pushWordToSortedArray = function(array, word){
256 256
     if(array.length === 0) {
257 257
         array.push(word);
258
-    }    else{
258
+    } else{
259 259
         if(array[array.length - 1].begin <= word.begin){
260 260
             array.push(word);
261 261
             return;

+ 1
- 1
modules/transcription/transcriptionServices/AbstractTranscriptionService.js 查看文件

@@ -24,7 +24,7 @@ TranscriptionService.prototype.send = function send(recordingResult, callback){
24 24
                    " is not valid!");
25 25
             recordingResult.wordArray = [];
26 26
             callback(recordingResult);
27
-        }        else{
27
+        } else{
28 28
             recordingResult.wordArray = t.formatResponse(response);
29 29
             callback(recordingResult);
30 30
         }

+ 3
- 3
modules/transcription/transcriptionServices/SphinxTranscriptionService.js 查看文件

@@ -85,7 +85,7 @@ SphinxService.prototype.verify = function(response){
85 85
     var json;
86 86
     try{
87 87
         json = JSON.parse(response);
88
-    }    catch (error){
88
+    } catch (error){
89 89
         console.log(error);
90 90
         return false;
91 91
     }
@@ -113,11 +113,11 @@ function getURL() {
113 113
     "Sphinx4 https server";
114 114
     if(config.sphinxURL === undefined){
115 115
         console.log(message);
116
-    }    else {
116
+    } else {
117 117
         var toReturn = config.sphinxURL;
118 118
         if(toReturn.includes !== undefined && toReturn.includes("https://")){
119 119
             return toReturn;
120
-        }        else{
120
+        } else{
121 121
             console.log(message);
122 122
         }
123 123
     }

+ 1
- 1
modules/util/EventEmitterForwarder.js 查看文件

@@ -7,7 +7,7 @@
7 7
  */
8 8
 function EventEmitterForwarder (src, dest) {
9 9
     if (!src || !dest || typeof src.addListener !== "function" ||
10
-        typeof dest.emit !== "function")        {
10
+        typeof dest.emit !== "function") {
11 11
         throw new Error("Invalid arguments passed to EventEmitterForwarder");
12 12
     }
13 13
     this.src = src;

+ 4
- 4
modules/util/GlobalOnErrorHandler.js 查看文件

@@ -22,7 +22,7 @@ function JitsiGlobalErrorHandler(message, source, lineno, colno, error) {
22 22
     handlers.forEach(function (handler) {
23 23
         handler(message, source, lineno, colno, error);
24 24
     });
25
-    if (oldOnErrorHandler)        {
25
+    if (oldOnErrorHandler) {
26 26
         oldOnErrorHandler(message, source, lineno, colno, error);
27 27
     }
28 28
 }
@@ -38,7 +38,7 @@ function JitsiGlobalUnhandledRejection(event) {
38 38
     handlers.forEach(function (handler) {
39 39
         handler(null, null, null, null, event.reason);
40 40
     });
41
-    if(oldOnUnhandledRejection)        {
41
+    if(oldOnUnhandledRejection) {
42 42
         oldOnUnhandledRejection(event);
43 43
     }
44 44
 }
@@ -62,7 +62,7 @@ var GlobalOnErrorHandler = {
62 62
      */
63 63
     callErrorHandler: function (error) {
64 64
         var errHandler = window.onerror;
65
-        if(!errHandler)            {
65
+        if(!errHandler) {
66 66
             return;
67 67
         }
68 68
         errHandler(null, null, null, null, error);
@@ -73,7 +73,7 @@ var GlobalOnErrorHandler = {
73 73
      */
74 74
     callUnhandledRejectionHandler: function (error) {
75 75
         var errHandler = window.onunhandledrejection;
76
-        if(!errHandler)            {
76
+        if(!errHandler) {
77 77
             return;
78 78
         }
79 79
         errHandler(error);

+ 3
- 3
modules/util/ScriptUtil.js 查看文件

@@ -38,16 +38,16 @@ var ScriptUtil = {
38 38
                 var scriptSrc = scriptEl.src;
39 39
                 var baseScriptSrc
40 40
                     = scriptSrc.substring(0, scriptSrc.lastIndexOf('/') + 1);
41
-                if (scriptSrc && baseScriptSrc)                    {
41
+                if (scriptSrc && baseScriptSrc) {
42 42
                     src = baseScriptSrc + src;
43 43
                 }
44 44
             }
45 45
         }
46 46
 
47
-        if (loadCallback)            {
47
+        if (loadCallback) {
48 48
             script.onload = loadCallback;
49 49
         }
50
-        if (errorCallback)            {
50
+        if (errorCallback) {
51 51
             script.onerror = errorCallback;
52 52
         }
53 53
 

+ 1
- 1
modules/util/UsernameGenerator.js 查看文件

@@ -433,7 +433,7 @@ function generateUsername () {
433 433
     var name = RandomUtil.randomElement(names);
434 434
     var suffix = RandomUtil.randomAlphanumStr(3);
435 435
 
436
-    return name + '-' +  suffix;
436
+    return name + '-' + suffix;
437 437
 }
438 438
 
439 439
 module.exports = {

+ 1
- 1
modules/version/ComponentsVersions.js 查看文件

@@ -74,7 +74,7 @@ ComponentsVersions.prototype.processPresence =
74 74
         }.bind(this));
75 75
 
76 76
     // logs versions to stats
77
-        if (log.length > 0)        {
77
+        if (log.length > 0) {
78 78
             Statistics.sendLog(JSON.stringify(log));
79 79
         }
80 80
     };

+ 1
- 1
modules/xmpp/Caps.js 查看文件

@@ -104,7 +104,7 @@ export default class Caps extends Listenable {
104 104
     getFeatures(jid, timeout = 5000) {
105 105
         const user
106 106
             = jid in this.jidToVersion ? this.jidToVersion[jid] : null;
107
-        if(!user || !(user.version in this.versionToCapabilities))        {
107
+        if(!user || !(user.version in this.versionToCapabilities)) {
108 108
             const node = user? user.node + "#" + user.version : null;
109 109
             return new Promise ( (resolve, reject) =>
110 110
                 this.disco.info(jid, node, response => {

+ 23
- 23
modules/xmpp/ChatRoom.js 查看文件

@@ -37,10 +37,10 @@ var parser = {
37 37
                 continue;
38 38
             }
39 39
             packet.c(node.tagName, node.attributes);
40
-            if(node.value)                {
40
+            if(node.value) {
41 41
                 packet.t(node.value);
42 42
             }
43
-            if(node.children)                {
43
+            if(node.children) {
44 44
                 this.json2packet(node.children, packet);
45 45
             }
46 46
             packet.up();
@@ -56,8 +56,8 @@ var parser = {
56 56
  */
57 57
 function filterNodeFromPresenceJSON(pres, nodeName){
58 58
     var res = [];
59
-    for(let i = 0; i < pres.length; i++)        {
60
-        if(pres[i].tagName === nodeName)            {
59
+    for(let i = 0; i < pres.length; i++) {
60
+        if(pres[i].tagName === nodeName) {
61 61
             res.push(pres[i]);
62 62
         }
63 63
     }
@@ -279,9 +279,9 @@ export default class ChatRoom extends Listenable {
279 279
         let jibri = null;
280 280
         // process nodes to extract data needed for MUC_JOINED and MUC_MEMBER_JOINED
281 281
         // events
282
-        for(let i = 0; i < nodes.length; i++)        {
282
+        for(let i = 0; i < nodes.length; i++) {
283 283
             const node = nodes[i];
284
-            switch(node.tagName)            {
284
+            switch(node.tagName) {
285 285
             case "nick":
286 286
                 member.nick = node.value;
287 287
                 break;
@@ -304,7 +304,7 @@ export default class ChatRoom extends Listenable {
304 304
                 logger.log("(TIME) MUC joined:\t", now);
305 305
 
306 306
                 // set correct initial state of locked
307
-                if (this.password)                    {
307
+                if (this.password) {
308 308
                     this.locked = true;
309 309
                 }
310 310
 
@@ -345,16 +345,16 @@ export default class ChatRoom extends Listenable {
345 345
             }
346 346
 
347 347
             // store the new display name
348
-            if(member.displayName)                {
348
+            if(member.displayName) {
349 349
                 memberOfThis.displayName = member.displayName;
350 350
             }
351 351
         }
352 352
 
353 353
         // after we had fired member or room joined events, lets fire events
354 354
         // for the rest info we got in presence
355
-        for(let i = 0; i < nodes.length; i++)        {
355
+        for(let i = 0; i < nodes.length; i++) {
356 356
             const node = nodes[i];
357
-            switch(node.tagName)            {
357
+            switch(node.tagName) {
358 358
             case "nick":
359 359
                 if(!member.isFocus) {
360 360
                     var displayName = this.xmpp.options.displayJids
@@ -377,7 +377,7 @@ export default class ChatRoom extends Listenable {
377 377
                 break;
378 378
             case "call-control":
379 379
                 var att = node.attributes;
380
-                if(!att)                        {
380
+                if(!att) {
381 381
                     break;
382 382
                 }
383 383
                 this.phoneNumber = att.phone || null;
@@ -394,9 +394,9 @@ export default class ChatRoom extends Listenable {
394 394
             this.eventEmitter.emit(XMPPEvents.PRESENCE_STATUS, from, member.status);
395 395
         }
396 396
 
397
-        if(jibri)        {
397
+        if(jibri) {
398 398
             this.lastJibri = jibri;
399
-            if(this.recording)                {
399
+            if(this.recording) {
400 400
                 this.recording.handleJibriPresence(jibri);
401 401
             }
402 402
         }
@@ -413,7 +413,7 @@ export default class ChatRoom extends Listenable {
413 413
             this.recording = new Recorder(this.options.recordingType,
414 414
                 this.eventEmitter, this.connection, this.focusMucJid,
415 415
                 this.options.jirecon, this.roomjid);
416
-            if(this.lastJibri)                {
416
+            if(this.lastJibri) {
417 417
                 this.recording.handleJibriPresence(this.lastJibri);
418 418
             }
419 419
         }
@@ -472,7 +472,7 @@ export default class ChatRoom extends Listenable {
472 472
 
473 473
         delete this.lastPresences[jid];
474 474
 
475
-        if(skipEvents)            {
475
+        if(skipEvents) {
476 476
             return;
477 477
         }
478 478
 
@@ -524,7 +524,7 @@ export default class ChatRoom extends Listenable {
524 524
 
525 525
             // we fire muc_left only if this is not a kick,
526 526
             // kick has both statuses 110 and 307.
527
-            if (!isKick)                {
527
+            if (!isKick) {
528 528
                 this.eventEmitter.emit(XMPPEvents.MUC_LEFT);
529 529
             }
530 530
         }
@@ -700,7 +700,7 @@ export default class ChatRoom extends Listenable {
700 700
 
701 701
     setVideoMute (mute, callback) {
702 702
         this.sendVideoInfoPresence(mute);
703
-        if(callback)            {
703
+        if(callback) {
704 704
             callback(mute);
705 705
         }
706 706
     }
@@ -717,12 +717,12 @@ export default class ChatRoom extends Listenable {
717 717
                 value: mute.toString()});
718 718
     }
719 719
 
720
-    sendAudioInfoPresence  (mute, callback) {
720
+    sendAudioInfoPresence (mute, callback) {
721 721
         this.addAudioInfoToPresence(mute);
722 722
         if(this.connection) {
723 723
             this.sendPresence();
724 724
         }
725
-        if(callback)            {
725
+        if(callback) {
726 726
             callback();
727 727
         }
728 728
     }
@@ -737,7 +737,7 @@ export default class ChatRoom extends Listenable {
737 737
 
738 738
     sendVideoInfoPresence (mute) {
739 739
         this.addVideoInfoToPresence(mute);
740
-        if(!this.connection)            {
740
+        if(!this.connection) {
741 741
             return;
742 742
         }
743 743
         this.sendPresence();
@@ -790,7 +790,7 @@ export default class ChatRoom extends Listenable {
790 790
      * Returns true if the recording is supproted and false if not.
791 791
      */
792 792
     isRecordingSupported () {
793
-        if(this.recording)            {
793
+        if(this.recording) {
794 794
             return this.recording.isSupported();
795 795
         }
796 796
         return false;
@@ -817,7 +817,7 @@ export default class ChatRoom extends Listenable {
817 817
      * @param statusChangeHandler {function} receives the new status as argument.
818 818
      */
819 819
     toggleRecording (options, statusChangeHandler) {
820
-        if(this.recording)            {
820
+        if(this.recording) {
821 821
             return this.recording.toggleRecording(options, statusChangeHandler);
822 822
         }
823 823
 
@@ -829,7 +829,7 @@ export default class ChatRoom extends Listenable {
829 829
      * Returns true if the SIP calls are supported and false otherwise
830 830
      */
831 831
     isSIPCallingSupported () {
832
-        if(this.moderator)            {
832
+        if(this.moderator) {
833 833
             return this.moderator.isSipGatewayEnabled();
834 834
         }
835 835
         return false;

+ 11
- 11
modules/xmpp/JingleSessionPC.js 查看文件

@@ -130,11 +130,11 @@ export default class JingleSessionPC extends JingleSession {
130 130
                 if (typeof protocol === 'string') {
131 131
                     protocol = protocol.toLowerCase();
132 132
                     if (protocol === 'tcp' || protocol === 'ssltcp') {
133
-                        if (this.webrtcIceTcpDisable)                            {
133
+                        if (this.webrtcIceTcpDisable) {
134 134
                             return;
135 135
                         }
136 136
                     } else if (protocol == 'udp') {
137
-                        if (this.webrtcIceUdpDisable)                            {
137
+                        if (this.webrtcIceUdpDisable) {
138 138
                             return;
139 139
                         }
140 140
                     }
@@ -195,13 +195,13 @@ export default class JingleSessionPC extends JingleSession {
195 195
 
196 196
                 break;
197 197
             case 'disconnected':
198
-                if (this.closed)                        {
198
+                if (this.closed) {
199 199
                     break;
200 200
                 }
201 201
                 this.isreconnect = true;
202 202
                     // Informs interested parties that the connection has been
203 203
                     // interrupted.
204
-                if (this.wasstable)                        {
204
+                if (this.wasstable) {
205 205
                     this.room.eventEmitter.emit(
206 206
                             XMPPEvents.CONNECTION_INTERRUPTED);
207 207
                 }
@@ -668,14 +668,14 @@ export default class JingleSessionPC extends JingleSession {
668 668
                 }
669 669
                 $(this).find('>parameter').each(function () {
670 670
                     lines += 'a=ssrc:' + ssrc + ' ' + $(this).attr('name');
671
-                    if ($(this).attr('value') && $(this).attr('value').length)                        {
671
+                    if ($(this).attr('value') && $(this).attr('value').length) {
672 672
                         lines += ':' + $(this).attr('value');
673 673
                     }
674 674
                     lines += '\r\n';
675 675
                 });
676 676
             });
677 677
             currentRemoteSdp.media.forEach(function(media, idx) {
678
-                if (!SDPUtil.find_line(media, 'a=mid:' + name))                    {
678
+                if (!SDPUtil.find_line(media, 'a=mid:' + name)) {
679 679
                     return;
680 680
                 }
681 681
                 if (!addSsrcInfo[idx]) {
@@ -1040,7 +1040,7 @@ export default class JingleSessionPC extends JingleSession {
1040 1040
                 ssrcs.push(ssrc);
1041 1041
             });
1042 1042
             currentRemoteSdp.media.forEach(function(media, idx) {
1043
-                if (!SDPUtil.find_line(media, 'a=mid:' + name))                    {
1043
+                if (!SDPUtil.find_line(media, 'a=mid:' + name)) {
1044 1044
                     return;
1045 1045
                 }
1046 1046
                 if (!removeSsrcInfo[idx]) {
@@ -1336,7 +1336,7 @@ export default class JingleSessionPC extends JingleSession {
1336 1336
             if (errorElSel.length) {
1337 1337
                 error.code = errorElSel.attr('code');
1338 1338
                 const errorReasonSel = $(errResponse).find('error :first');
1339
-                if (errorReasonSel.length)                    {
1339
+                if (errorReasonSel.length) {
1340 1340
                     error.reason = errorReasonSel[0].tagName;
1341 1341
                 }
1342 1342
             }
@@ -1450,7 +1450,7 @@ export default class JingleSessionPC extends JingleSession {
1450 1450
             ssrcs.forEach(function (ssrcObj) {
1451 1451
                 const desc = $(jingle.tree()).find(">jingle>content[name=\"" +
1452 1452
                     ssrcObj.mtype + "\"]>description");
1453
-                if (!desc || !desc.length)                    {
1453
+                if (!desc || !desc.length) {
1454 1454
                     return;
1455 1455
                 }
1456 1456
                 ssrcObj.ssrcs.forEach(function (ssrc) {
@@ -1516,7 +1516,7 @@ export default class JingleSessionPC extends JingleSession {
1516 1516
     fixSourceRemoveJingle(jingle) {
1517 1517
         let ssrcs = this.modifiedSSRCs["mute"];
1518 1518
         this.modifiedSSRCs["mute"] = [];
1519
-        if (ssrcs && ssrcs.length)            {
1519
+        if (ssrcs && ssrcs.length) {
1520 1520
             ssrcs.forEach(function (ssrcObj) {
1521 1521
                 ssrcObj.ssrcs.forEach(function (ssrc) {
1522 1522
                     const sourceNode
@@ -1539,7 +1539,7 @@ export default class JingleSessionPC extends JingleSession {
1539 1539
 
1540 1540
         ssrcs = this.modifiedSSRCs["remove"];
1541 1541
         this.modifiedSSRCs["remove"] = [];
1542
-        if (ssrcs && ssrcs.length)            {
1542
+        if (ssrcs && ssrcs.length) {
1543 1543
             ssrcs.forEach(function (ssrcObj) {
1544 1544
                 const desc
1545 1545
                     = JingleSessionPC.createDescriptionNode(

+ 1
- 1
modules/xmpp/RtxModifier.js 查看文件

@@ -1,7 +1,7 @@
1 1
 /* global __filename */
2 2
 
3 3
 import { getLogger } from "jitsi-meet-logger";
4
-import { parseSecondarySSRC, SdpTransformWrap  } from './SdpTransformUtil';
4
+import { parseSecondarySSRC, SdpTransformWrap } from './SdpTransformUtil';
5 5
 import * as SDPUtil from "./SDPUtil";
6 6
 
7 7
 const logger = getLogger(__filename);

+ 9
- 9
modules/xmpp/SDP.js 查看文件

@@ -92,7 +92,7 @@ SDP.prototype.containsSSRC = function (ssrc) {
92 92
     var medias = this.getMediaSsrcMap();
93 93
     var result = false;
94 94
     Object.keys(medias).forEach(function (mediaindex) {
95
-        if (result)            {
95
+        if (result) {
96 96
             return;
97 97
         }
98 98
         if (medias[mediaindex].ssrcs[ssrc]) {
@@ -109,7 +109,7 @@ SDP.prototype.mangle = function () {
109 109
         lines = this.media[i].split('\r\n');
110 110
         lines.pop(); // remove empty last element
111 111
         mline = SDPUtil.parse_mline(lines.shift());
112
-        if (mline.media != 'audio')            {
112
+        if (mline.media != 'audio') {
113 113
             continue;
114 114
         }
115 115
         newdesc = '';
@@ -117,7 +117,7 @@ SDP.prototype.mangle = function () {
117 117
         for (j = 0; j < lines.length; j++) {
118 118
             if (lines[j].substr(0, 9) == 'a=rtpmap:') {
119 119
                 rtpmap = SDPUtil.parse_rtpmap(lines[j]);
120
-                if (rtpmap.name == 'CN' || rtpmap.name == 'ISAC')                    {
120
+                if (rtpmap.name == 'CN' || rtpmap.name == 'ISAC') {
121 121
                     continue;
122 122
                 }
123 123
                 mline.fmt.push(rtpmap.id);
@@ -371,7 +371,7 @@ SDP.prototype.transportToJingle = function (mediaindex, elem) {
371 371
             protocol: sctpAttrs[1] /* protocol */
372 372
         });
373 373
         // Optional stream count attribute
374
-        if (sctpAttrs.length > 2)            {
374
+        if (sctpAttrs.length > 2) {
375 375
             elem.attrs({ streams: sctpAttrs[2]});
376 376
         }
377 377
         elem.up();
@@ -526,15 +526,15 @@ SDP.prototype.jingle2media = function (content) {
526 526
             ' ' + sctp.attr('protocol');
527 527
 
528 528
         var streamCount = sctp.attr('streams');
529
-        if (streamCount)            {
529
+        if (streamCount) {
530 530
             media += ' ' + streamCount + '\r\n';
531
-        }        else            {
531
+        } else {
532 532
             media += '\r\n';
533 533
         }
534 534
     }
535 535
 
536 536
     media += 'c=IN IP4 0.0.0.0\r\n';
537
-    if (!sctp.length)        {
537
+    if (!sctp.length) {
538 538
         media += 'a=rtcp:1 IN IP4 0.0.0.0\r\n';
539 539
     }
540 540
     tmp = content.find('>transport[xmlns="urn:xmpp:jingle:transports:ice-udp:1"]');
@@ -621,7 +621,7 @@ SDP.prototype.jingle2media = function (content) {
621 621
                 && (protocol === 'tcp' || protocol === 'ssltcp')) ||
622 622
             (self.removeUdpCandidates && protocol === 'udp')) {
623 623
             return;
624
-        } else  if (self.failICE) {
624
+        } else if (self.failICE) {
625 625
             this.setAttribute('ip', '1.1.1.1');
626 626
         }
627 627
 
@@ -648,7 +648,7 @@ SDP.prototype.jingle2media = function (content) {
648 648
             var value = this.getAttribute('value');
649 649
             value = SDPUtil.filter_special_chars(value);
650 650
             media += 'a=ssrc:' + ssrc + ' ' + name;
651
-            if (value && value.length)                {
651
+            if (value && value.length) {
652 652
                 media += ':' + value;
653 653
             }
654 654
             media += '\r\n';

+ 4
- 4
modules/xmpp/SDPDiffer.js 查看文件

@@ -14,12 +14,12 @@ SDPDiffer.prototype.getNewMedia = function() {
14 14
     // this could be useful in Array.prototype.
15 15
     function arrayEquals(array) {
16 16
         // if the other array is a falsy value, return
17
-        if (!array)            {
17
+        if (!array) {
18 18
             return false;
19 19
         }
20 20
 
21 21
         // compare lengths - can save a lot of time
22
-        if (this.length != array.length)            {
22
+        if (this.length != array.length) {
23 23
             return false;
24 24
         }
25 25
 
@@ -27,10 +27,10 @@ SDPDiffer.prototype.getNewMedia = function() {
27 27
             // Check if we have nested arrays
28 28
             if (this[i] instanceof Array && array[i] instanceof Array) {
29 29
                 // recurse into the nested arrays
30
-                if (!this[i].equals(array[i]))                    {
30
+                if (!this[i].equals(array[i])) {
31 31
                     return false;
32 32
                 }
33
-            }            else if (this[i] != array[i]) {
33
+            } else if (this[i] != array[i]) {
34 34
                 // Warning - two different object instances will never be
35 35
                 // equal: {x:20} != {x:20}
36 36
                 return false;

+ 2
- 2
modules/xmpp/SDPUtil.js 查看文件

@@ -66,7 +66,7 @@ var SDPUtil = {
66 66
      * @param line eg. "a=sctpmap:5000 webrtc-datachannel"
67 67
      * @returns [SCTP port number, protocol, streams]
68 68
      */
69
-    parse_sctpmap: function (line)    {
69
+    parse_sctpmap: function (line) {
70 70
         var parts = line.substring(10).split(' ');
71 71
         var sctpPort = parts[0];
72 72
         var protocol = parts[1];
@@ -244,7 +244,7 @@ var SDPUtil = {
244 244
         var lines = haystack.split('\r\n'),
245 245
             needles = [];
246 246
         for (var i = 0; i < lines.length; i++) {
247
-            if (lines[i].substring(0, needle.length) == needle)                {
247
+            if (lines[i].substring(0, needle.length) == needle) {
248 248
                 needles.push(lines[i]);
249 249
             }
250 250
         }

+ 11
- 11
modules/xmpp/moderator.js 查看文件

@@ -62,16 +62,16 @@ function Moderator(roomName, xmpp, emitter, options) {
62 62
     }
63 63
 }
64 64
 
65
-Moderator.prototype.isExternalAuthEnabled =  function () {
65
+Moderator.prototype.isExternalAuthEnabled = function () {
66 66
     return this.externalAuthEnabled;
67 67
 };
68 68
 
69
-Moderator.prototype.isSipGatewayEnabled =  function () {
69
+Moderator.prototype.isSipGatewayEnabled = function () {
70 70
     return this.sipGatewayEnabled;
71 71
 };
72 72
 
73 73
 
74
-Moderator.prototype.onMucMemberLeft =  function (jid) {
74
+Moderator.prototype.onMucMemberLeft = function (jid) {
75 75
     logger.info("Someone left is it focus ? " + jid);
76 76
     var resource = Strophe.getResourceFromJid(jid);
77 77
     if (resource === 'focus') {
@@ -82,7 +82,7 @@ Moderator.prototype.onMucMemberLeft =  function (jid) {
82 82
 };
83 83
 
84 84
 
85
-Moderator.prototype.setFocusUserJid =  function (focusJid) {
85
+Moderator.prototype.setFocusUserJid = function (focusJid) {
86 86
     if (!this.focusUserJid) {
87 87
         this.focusUserJid = focusJid;
88 88
         logger.info("Focus jid set to:  " + this.focusUserJid);
@@ -90,11 +90,11 @@ Moderator.prototype.setFocusUserJid =  function (focusJid) {
90 90
 };
91 91
 
92 92
 
93
-Moderator.prototype.getFocusUserJid =  function () {
93
+Moderator.prototype.getFocusUserJid = function () {
94 94
     return this.focusUserJid;
95 95
 };
96 96
 
97
-Moderator.prototype.getFocusComponent =  function () {
97
+Moderator.prototype.getFocusComponent = function () {
98 98
     // Get focus component address
99 99
     var focusComponent = this.options.connection.hosts.focus;
100 100
     // If not specified use default:  'focus.domain'
@@ -104,7 +104,7 @@ Moderator.prototype.getFocusComponent =  function () {
104 104
     return focusComponent;
105 105
 };
106 106
 
107
-Moderator.prototype.createConferenceIq =  function () {
107
+Moderator.prototype.createConferenceIq = function () {
108 108
     // Generate create conference IQ
109 109
     var elem = $iq({to: this.getFocusComponent(), type: 'set'});
110 110
 
@@ -218,7 +218,7 @@ Moderator.prototype.createConferenceIq =  function () {
218 218
 };
219 219
 
220 220
 
221
-Moderator.prototype.parseSessionId =  function (resultIq) {
221
+Moderator.prototype.parseSessionId = function (resultIq) {
222 222
     var sessionId = $(resultIq).find('conference').attr('session-id');
223 223
     if (sessionId) {
224 224
         logger.info('Received sessionId:  ' + sessionId);
@@ -226,7 +226,7 @@ Moderator.prototype.parseSessionId =  function (resultIq) {
226 226
     }
227 227
 };
228 228
 
229
-Moderator.prototype.parseConfigOptions =  function (resultIq) {
229
+Moderator.prototype.parseConfigOptions = function (resultIq) {
230 230
 
231 231
     this.setFocusUserJid(
232 232
         $(resultIq).find('conference').attr('focusjid'));
@@ -274,7 +274,7 @@ Moderator.prototype.parseConfigOptions =  function (resultIq) {
274 274
  * @param {Function} callback - the function to be called back upon the
275 275
  * successful allocation of the conference focus
276 276
  */
277
-Moderator.prototype.allocateConferenceFocus =  function (callback) {
277
+Moderator.prototype.allocateConferenceFocus = function (callback) {
278 278
     // Try to use focus user JID from the config
279 279
     this.setFocusUserJid(this.options.connection.focusUserJid);
280 280
     // Send create conference IQ
@@ -454,7 +454,7 @@ Moderator.prototype.getPopupLoginUrl = function (urlCallback, failureCallback) {
454 454
     this._getLoginUrl(/* popup */ true, urlCallback, failureCallback);
455 455
 };
456 456
 
457
-Moderator.prototype.logout =  function (callback) {
457
+Moderator.prototype.logout = function (callback) {
458 458
     var iq = $iq({to: this.getFocusComponent(), type: 'set'});
459 459
     var sessionId = Settings.getSessionId();
460 460
     if (!sessionId) {

+ 9
- 9
modules/xmpp/recording.js 查看文件

@@ -17,7 +17,7 @@ function Recording(type, eventEmitter, connection, focusMucJid, jirecon,
17 17
     this.url = null;
18 18
     this.type = type;
19 19
     this._isSupported
20
-        =  type === Recording.types.JIRECON && !this.jirecon
20
+        = type === Recording.types.JIRECON && !this.jirecon
21 21
             || (type !== Recording.types.JIBRI
22 22
                 && type !== Recording.types.COLIBRI)
23 23
             ? false : true;
@@ -55,28 +55,28 @@ Recording.action = {
55 55
 
56 56
 Recording.prototype.handleJibriPresence = function (jibri) {
57 57
     var attributes = jibri.attributes;
58
-    if(!attributes)        {
58
+    if(!attributes) {
59 59
         return;
60 60
     }
61 61
 
62 62
     var newState = attributes.status;
63 63
     logger.log("Handle jibri presence : ", newState);
64 64
 
65
-    if (newState === this.state)        {
65
+    if (newState === this.state) {
66 66
         return;
67 67
     }
68 68
 
69 69
     if (newState === "undefined") {
70 70
         this.state = Recording.status.UNAVAILABLE;
71
-    }    else if (newState === "off") {
71
+    } else if (newState === "off") {
72 72
         if (!this.state
73 73
             || this.state === "undefined"
74
-            || this.state === Recording.status.UNAVAILABLE)            {
74
+            || this.state === Recording.status.UNAVAILABLE) {
75 75
             this.state = Recording.status.AVAILABLE;
76
-        }        else            {
76
+        } else {
77 77
             this.state = Recording.status.OFF;
78 78
         }
79
-    }    else {
79
+    } else {
80 80
         this.state = newState;
81 81
     }
82 82
 
@@ -225,10 +225,10 @@ Recording.prototype.toggleRecording = function (options, statusChangeHandler) {
225 225
 
226 226
     // If the recorder is currently unavailable we throw an error.
227 227
     if (oldState === Recording.status.UNAVAILABLE
228
-        || oldState === Recording.status.FAILED)        {
228
+        || oldState === Recording.status.FAILED) {
229 229
         statusChangeHandler(Recording.status.FAILED,
230 230
                             JitsiRecorderErrors.RECORDER_UNAVAILABLE);
231
-    }    else if (oldState === Recording.status.BUSY)        {
231
+    } else if (oldState === Recording.status.BUSY) {
232 232
         statusChangeHandler(Recording.status.BUSY,
233 233
                             JitsiRecorderErrors.RECORDER_BUSY);
234 234
     }

+ 5
- 5
modules/xmpp/strophe.emuc.js 查看文件

@@ -61,7 +61,7 @@ class MucConnectionPlugin extends ConnectionPluginListenable {
61 61
         }
62 62
 
63 63
         const room = this.rooms[Strophe.getBareJidFromJid(from)];
64
-        if(!room)            {
64
+        if(!room) {
65 65
             return;
66 66
         }
67 67
 
@@ -79,7 +79,7 @@ class MucConnectionPlugin extends ConnectionPluginListenable {
79 79
     onPresenceUnavailable (pres) {
80 80
         const from = pres.getAttribute('from');
81 81
         const room = this.rooms[Strophe.getBareJidFromJid(from)];
82
-        if(!room)            {
82
+        if(!room) {
83 83
             return;
84 84
         }
85 85
 
@@ -90,7 +90,7 @@ class MucConnectionPlugin extends ConnectionPluginListenable {
90 90
     onPresenceError (pres) {
91 91
         const from = pres.getAttribute('from');
92 92
         const room = this.rooms[Strophe.getBareJidFromJid(from)];
93
-        if(!room)            {
93
+        if(!room) {
94 94
             return;
95 95
         }
96 96
 
@@ -102,7 +102,7 @@ class MucConnectionPlugin extends ConnectionPluginListenable {
102 102
         // FIXME: this is a hack. but jingle on muc makes nickchanges hard
103 103
         const from = msg.getAttribute('from');
104 104
         const room = this.rooms[Strophe.getBareJidFromJid(from)];
105
-        if(!room)            {
105
+        if(!room) {
106 106
             return;
107 107
         }
108 108
 
@@ -113,7 +113,7 @@ class MucConnectionPlugin extends ConnectionPluginListenable {
113 113
     onMute(iq) {
114 114
         const from = iq.getAttribute('from');
115 115
         const room = this.rooms[Strophe.getBareJidFromJid(from)];
116
-        if(!room)            {
116
+        if(!room) {
117 117
             return;
118 118
         }
119 119
 

+ 4
- 4
modules/xmpp/xmpp.js 查看文件

@@ -121,14 +121,14 @@ export default class XMPP extends Listenable {
121 121
             this.connection.ping.hasPingSupport(
122 122
                 pingJid,
123 123
                 function (hasPing) {
124
-                    if (hasPing)                        {
124
+                    if (hasPing) {
125 125
                         this.connection.ping.startInterval(pingJid);
126
-                    }                    else                        {
126
+                    } else {
127 127
                         logger.warn("Ping NOT supported by " + pingJid);
128 128
                     }
129 129
                 }.bind(this));
130 130
 
131
-            if (password)                {
131
+            if (password) {
132 132
                 this.authenticatedUser = true;
133 133
             }
134 134
             if (this.connection && this.connection.connected &&
@@ -268,7 +268,7 @@ export default class XMPP extends Listenable {
268 268
     createRoom (roomName, options) {
269 269
         // By default MUC nickname is the resource part of the JID
270 270
         let mucNickname = Strophe.getNodeFromJid(this.connection.jid);
271
-        let roomjid = roomName  + "@" + this.options.hosts.muc + "/";
271
+        let roomjid = roomName + "@" + this.options.hosts.muc + "/";
272 272
         const cfgNickname
273 273
             = options.useNicks && options.nick ? options.nick : null;
274 274
 

Loading…
取消
儲存