Parcourir la source

fix(eslint): Add curly rule

master
hristoterezov il y a 8 ans
Parent
révision
c36b464bfc

+ 1
- 0
.eslintrc.js Voir le fichier

@@ -75,6 +75,7 @@ module.exports = {
75 75
         'block-scoped-var': 0,
76 76
         'complexity': 0,
77 77
         'consistent-return': 0,
78
+        'curly': 2,
78 79
 
79 80
         'prefer-const': 2,
80 81
         'prefer-reflect': 0,

+ 22
- 22
JitsiConference.js Voir le fichier

@@ -95,7 +95,7 @@ function JitsiConference(options) {
95 95
  */
96 96
 JitsiConference.prototype._init = function (options) {
97 97
     if (!options)
98
-        options = {};
98
+        {options = {};}
99 99
 
100 100
     // Override connection and xmpp properties (Usefull if the connection
101 101
     // reloaded)
@@ -152,7 +152,7 @@ JitsiConference.prototype._init = function (options) {
152 152
  */
153 153
 JitsiConference.prototype.join = function (password) {
154 154
     if (this.room)
155
-        this.room.join(password);
155
+        {this.room.join(password);}
156 156
 };
157 157
 
158 158
 /**
@@ -176,7 +176,7 @@ JitsiConference.prototype.leave = function () {
176 176
 
177 177
     this.rtc.closeAllDataChannels();
178 178
     if (this.statistics)
179
-        this.statistics.dispose();
179
+        {this.statistics.dispose();}
180 180
 
181 181
     // leave the conference
182 182
     if (this.room) {
@@ -295,7 +295,7 @@ JitsiConference.prototype.getLocalVideoTrack = function () {
295 295
  */
296 296
 JitsiConference.prototype.on = function (eventId, handler) {
297 297
     if (this.eventEmitter)
298
-        this.eventEmitter.on(eventId, handler);
298
+        {this.eventEmitter.on(eventId, handler);}
299 299
 };
300 300
 
301 301
 /**
@@ -307,7 +307,7 @@ JitsiConference.prototype.on = function (eventId, handler) {
307 307
  */
308 308
 JitsiConference.prototype.off = function (eventId, handler) {
309 309
     if (this.eventEmitter)
310
-        this.eventEmitter.removeListener(eventId, handler);
310
+        {this.eventEmitter.removeListener(eventId, handler);}
311 311
 };
312 312
 
313 313
 // Common aliases for event emitter
@@ -322,7 +322,7 @@ JitsiConference.prototype.removeEventListener = JitsiConference.prototype.off;
322 322
  */
323 323
  JitsiConference.prototype.addCommandListener = function (command, handler) {
324 324
     if (this.room)
325
-        this.room.addPresenceListener(command, handler);
325
+        {this.room.addPresenceListener(command, handler);}
326 326
  };
327 327
 
328 328
 /**
@@ -331,7 +331,7 @@ JitsiConference.prototype.removeEventListener = JitsiConference.prototype.off;
331 331
   */
332 332
  JitsiConference.prototype.removeCommandListener = function (command) {
333 333
     if (this.room)
334
-        this.room.removePresenceListener(command);
334
+        {this.room.removePresenceListener(command);}
335 335
  };
336 336
 
337 337
 /**
@@ -340,7 +340,7 @@ JitsiConference.prototype.removeEventListener = JitsiConference.prototype.off;
340 340
  */
341 341
 JitsiConference.prototype.sendTextMessage = function (message) {
342 342
     if (this.room)
343
-        this.room.sendMessage(message);
343
+        {this.room.sendMessage(message);}
344 344
 };
345 345
 
346 346
 /**
@@ -371,7 +371,7 @@ JitsiConference.prototype.sendCommandOnce = function (name, values) {
371 371
  **/
372 372
 JitsiConference.prototype.removeCommand = function (name) {
373 373
     if (this.room)
374
-        this.room.removeFromPresence(name);
374
+        {this.room.removeFromPresence(name);}
375 375
 };
376 376
 
377 377
 /**
@@ -488,7 +488,7 @@ JitsiConference.prototype.onLocalTrackRemoved = function (track) {
488 488
     // FIXME: we assume we have only one screen sharing track
489 489
     // if we change this we need to fix this check
490 490
     if (track.isVideoTrack() && track.videoType === VideoType.DESKTOP)
491
-        this.statistics.sendScreenSharingEvent(false);
491
+        {this.statistics.sendScreenSharingEvent(false);}
492 492
 
493 493
     this.eventEmitter.emit(JitsiConferenceEvents.TRACK_REMOVED, track);
494 494
 };
@@ -626,7 +626,7 @@ JitsiConference.prototype._setupNewTrack = function (newTrack) {
626 626
     // FIXME: we assume we have only one screen sharing track
627 627
     // if we change this we need to fix this check
628 628
     if (newTrack.isVideoTrack() && newTrack.videoType === VideoType.DESKTOP)
629
-        this.statistics.sendScreenSharingEvent(true);
629
+        {this.statistics.sendScreenSharingEvent(true);}
630 630
 
631 631
     this.eventEmitter.emit(JitsiConferenceEvents.TRACK_ADDED, newTrack);
632 632
 };
@@ -878,8 +878,8 @@ JitsiConference.prototype.onMemberLeft = function (jid) {
878 878
 
879 879
     // there can be no participant in case the member that left is focus
880 880
     if (participant)
881
-        this.eventEmitter.emit(
882
-            JitsiConferenceEvents.USER_LEFT, id, participant);
881
+        {this.eventEmitter.emit(
882
+            JitsiConferenceEvents.USER_LEFT, id, participant);}
883 883
 };
884 884
 
885 885
 JitsiConference.prototype.onUserRoleChanged = function (jid, role) {
@@ -900,7 +900,7 @@ JitsiConference.prototype.onDisplayNameChanged = function (jid, displayName) {
900 900
     }
901 901
 
902 902
     if (participant._displayName === displayName)
903
-        return;
903
+        {return;}
904 904
 
905 905
     participant._displayName = displayName;
906 906
     this.eventEmitter.emit(JitsiConferenceEvents.DISPLAY_NAME_CHANGED, id, displayName);
@@ -1218,7 +1218,7 @@ JitsiConference.prototype.sendTones = function (tones, duration, pause) {
1218 1218
  */
1219 1219
 JitsiConference.prototype.isRecordingSupported = function () {
1220 1220
     if (this.room)
1221
-        return this.room.isRecordingSupported();
1221
+        {return this.room.isRecordingSupported();}
1222 1222
     return false;
1223 1223
 };
1224 1224
 
@@ -1242,10 +1242,10 @@ JitsiConference.prototype.getRecordingURL = function () {
1242 1242
  */
1243 1243
 JitsiConference.prototype.toggleRecording = function (options) {
1244 1244
     if (this.room)
1245
-        return this.room.toggleRecording(options, function (status, error) {
1245
+        {return this.room.toggleRecording(options, function (status, error) {
1246 1246
             this.eventEmitter.emit(
1247 1247
                 JitsiConferenceEvents.RECORDER_STATE_CHANGED, status, error);
1248
-        }.bind(this));
1248
+        }.bind(this));}
1249 1249
     this.eventEmitter.emit(
1250 1250
         JitsiConferenceEvents.RECORDER_STATE_CHANGED, "error",
1251 1251
         new Error("The conference is not created yet!"));
@@ -1256,7 +1256,7 @@ JitsiConference.prototype.toggleRecording = function (options) {
1256 1256
  */
1257 1257
 JitsiConference.prototype.isSIPCallingSupported = function () {
1258 1258
     if (this.room)
1259
-        return this.room.isSIPCallingSupported();
1259
+        {return this.room.isSIPCallingSupported();}
1260 1260
     return false;
1261 1261
 };
1262 1262
 
@@ -1266,7 +1266,7 @@ JitsiConference.prototype.isSIPCallingSupported = function () {
1266 1266
  */
1267 1267
 JitsiConference.prototype.dial = function (number) {
1268 1268
     if (this.room)
1269
-        return this.room.dial(number);
1269
+        {return this.room.dial(number);}
1270 1270
     return new Promise(function(resolve, reject){
1271 1271
         reject(new Error("The conference is not created yet!"));});
1272 1272
 };
@@ -1276,7 +1276,7 @@ JitsiConference.prototype.dial = function (number) {
1276 1276
  */
1277 1277
 JitsiConference.prototype.hangup = function () {
1278 1278
     if (this.room)
1279
-        return this.room.hangup();
1279
+        {return this.room.hangup();}
1280 1280
     return new Promise(function(resolve, reject){
1281 1281
         reject(new Error("The conference is not created yet!"));});
1282 1282
 };
@@ -1286,7 +1286,7 @@ JitsiConference.prototype.hangup = function () {
1286 1286
  */
1287 1287
 JitsiConference.prototype.getPhoneNumber = function () {
1288 1288
     if (this.room)
1289
-        return this.room.getPhoneNumber();
1289
+        {return this.room.getPhoneNumber();}
1290 1290
     return null;
1291 1291
 };
1292 1292
 
@@ -1295,7 +1295,7 @@ JitsiConference.prototype.getPhoneNumber = function () {
1295 1295
  */
1296 1296
 JitsiConference.prototype.getPhonePin = function () {
1297 1297
     if (this.room)
1298
-        return this.room.getPhonePin();
1298
+        {return this.room.getPhonePin();}
1299 1299
     return null;
1300 1300
 };
1301 1301
 

+ 4
- 4
JitsiConferenceEventManager.js Voir le fichier

@@ -24,7 +24,7 @@ function JitsiConferenceEventManager(conference) {
24 24
     conference.on(JitsiConferenceEvents.TRACK_MUTE_CHANGED,
25 25
         function (track) {
26 26
             if(!track.isLocal() || !conference.statistics)
27
-                return;
27
+                {return;}
28 28
             conference.statistics.sendMuteEvent(track.isMuted(),
29 29
                 track.getType());
30 30
         });
@@ -528,12 +528,12 @@ JitsiConferenceEventManager.prototype.setupXMPPListeners = function () {
528 528
 JitsiConferenceEventManager.prototype.setupStatisticsListeners = function () {
529 529
     var conference = this.conference;
530 530
     if(!conference.statistics)
531
-        return;
531
+        {return;}
532 532
 
533 533
     conference.statistics.addAudioLevelListener(function (ssrc, level) {
534 534
         var resource = conference.rtc.getResourceBySSRC(ssrc);
535 535
         if (!resource)
536
-            return;
536
+            {return;}
537 537
 
538 538
         conference.rtc.setAudioLevel(resource, level);
539 539
     });
@@ -579,7 +579,7 @@ JitsiConferenceEventManager.prototype.setupStatisticsListeners = function () {
579 579
         conference.getLocalTracks(MediaType.AUDIO).forEach(function (track) {
580 580
             const ssrc = track.getSSRC();
581 581
             if (!ssrc || !stats.hasOwnProperty(ssrc))
582
-                return;
582
+                {return;}
583 583
 
584 584
             track._setByteSent(stats[ssrc]);
585 585
         });

+ 3
- 3
JitsiConnection.js Voir le fichier

@@ -30,8 +30,8 @@ function JitsiConnection(appID, token, options) {
30 30
             // and then there are no msgs, but we want to log only disconnects
31 31
             // when there is real error
32 32
             if(msg)
33
-                Statistics.analytics.sendEvent(
34
-                    'connection.disconnected.' + msg);
33
+                {Statistics.analytics.sendEvent(
34
+                    'connection.disconnected.' + msg);}
35 35
             Statistics.sendLog(
36 36
                 JSON.stringify({id: "connection.disconnected", msg: msg}));
37 37
         });
@@ -44,7 +44,7 @@ function JitsiConnection(appID, token, options) {
44 44
  */
45 45
 JitsiConnection.prototype.connect = function (options) {
46 46
     if(!options)
47
-        options = {};
47
+        {options = {};}
48 48
 
49 49
     this.xmpp.connect(options.id, options.password);
50 50
 };

+ 4
- 4
JitsiMeetJS.js Voir le fichier

@@ -32,7 +32,7 @@ var USER_MEDIA_PERMISSION_PROMPT_TIMEOUT = 500;
32 32
 
33 33
 function getLowerResolution(resolution) {
34 34
     if(!Resolutions[resolution])
35
-        return null;
35
+        {return null;}
36 36
     var order = Resolutions[resolution].order;
37 37
     var res = null;
38 38
     var resName = null;
@@ -224,7 +224,7 @@ var LibJitsiMeet = {
224 224
         }
225 225
 
226 226
         if(!window.connectionTimes)
227
-            window.connectionTimes = {};
227
+            {window.connectionTimes = {};}
228 228
         window.connectionTimes["obtainPermissions.start"] =
229 229
             window.performance.now();
230 230
 
@@ -239,7 +239,7 @@ var LibJitsiMeet = {
239 239
                     "getUserMedia.success", options), {value: options});
240 240
 
241 241
                 if(!RTC.options.disableAudioLevels)
242
-                    for(let i = 0; i < tracks.length; i++) {
242
+                    {for(let i = 0; i < tracks.length; i++) {
243 243
                         const track = tracks[i];
244 244
                         var mStream = track.getOriginalStream();
245 245
                         if(track.getType() === MediaType.AUDIO){
@@ -251,7 +251,7 @@ var LibJitsiMeet = {
251 251
                                     Statistics.stopLocalStats(mStream);
252 252
                                 });
253 253
                         }
254
-                    }
254
+                    }}
255 255
 
256 256
                 // set real device ids
257 257
                 var currentlyAvailableMediaDevices

+ 7
- 7
doc/example/example.js Voir le fichier

@@ -48,7 +48,7 @@ function onLocalTracks(tracks)
48 48
             localTracks[i].attach($("#localAudio" + i)[0]);
49 49
         }
50 50
         if(isJoined)
51
-            room.addTrack(localTracks[i]);
51
+            {room.addTrack(localTracks[i]);}
52 52
     }
53 53
 }
54 54
 
@@ -58,10 +58,10 @@ function onLocalTracks(tracks)
58 58
  */
59 59
 function onRemoteTrack(track) {
60 60
     if(track.isLocal())
61
-        return;
61
+        {return;}
62 62
     var participant = track.getParticipantId();
63 63
     if(!remoteTracks[participant])
64
-        remoteTracks[participant] = [];
64
+        {remoteTracks[participant] = [];}
65 65
     var idx = remoteTracks[participant].push(track);
66 66
     track.addEventListener(JitsiMeetJS.events.track.TRACK_AUDIO_LEVEL_CHANGED,
67 67
         function (audioLevel) {
@@ -95,16 +95,16 @@ function onConferenceJoined () {
95 95
     console.log("conference joined!");
96 96
     isJoined = true;
97 97
     for(var i = 0; i < localTracks.length; i++)
98
-        room.addTrack(localTracks[i]);
98
+        {room.addTrack(localTracks[i]);}
99 99
 }
100 100
 
101 101
 function onUserLeft(id) {
102 102
     console.log("user left");
103 103
     if(!remoteTracks[id])
104
-        return;
104
+        {return;}
105 105
     var tracks = remoteTracks[id];
106 106
     for(var i = 0; i< tracks.length; i++)
107
-        tracks[i].detach($("#" + id + tracks[i].getType()));
107
+        {tracks[i].detach($("#" + id + tracks[i].getType()));}
108 108
 }
109 109
 
110 110
 /**
@@ -168,7 +168,7 @@ function disconnect(){
168 168
 
169 169
 function unload() {
170 170
     for(var i = 0; i < localTracks.length; i++)
171
-        localTracks[i].stop();
171
+        {localTracks[i].stop();}
172 172
     room.leave();
173 173
     connection.disconnect();
174 174
 }

+ 3
- 3
modules/RTC/DataChannels.js Voir le fichier

@@ -163,7 +163,7 @@ DataChannels.prototype.onDataChannel = function (event) {
163 163
         logger.info("The Data Channel closed", dataChannel);
164 164
         var idx = self._dataChannels.indexOf(dataChannel);
165 165
         if (idx > -1)
166
-            self._dataChannels = self._dataChannels.splice(idx, 1);
166
+            {self._dataChannels = self._dataChannels.splice(idx, 1);}
167 167
     };
168 168
     this._dataChannels.push(dataChannel);
169 169
 };
@@ -240,9 +240,9 @@ DataChannels.prototype._some = function (callback, thisArg) {
240 240
 
241 241
     if (dataChannels && dataChannels.length !== 0) {
242 242
         if (thisArg)
243
-            return dataChannels.some(callback, thisArg);
243
+            {return dataChannels.some(callback, thisArg);}
244 244
         else
245
-            return dataChannels.some(callback);
245
+            {return dataChannels.some(callback);}
246 246
     } else {
247 247
         return false;
248 248
     }

+ 12
- 12
modules/RTC/JitsiLocalTrack.js Voir le fichier

@@ -35,8 +35,8 @@ function JitsiLocalTrack(stream, track, mediaType, videoType, resolution,
35 35
         null /* RTC */, stream, track,
36 36
         function () {
37 37
             if(!this.dontFireRemoveEvent)
38
-                this.eventEmitter.emit(
39
-                    JitsiTrackEvents.LOCAL_TRACK_STOPPED);
38
+                {this.eventEmitter.emit(
39
+                    JitsiTrackEvents.LOCAL_TRACK_STOPPED);}
40 40
             this.dontFireRemoveEvent = false;
41 41
         }.bind(this) /* inactiveHandler */,
42 42
         mediaType, videoType, null /* ssrc */);
@@ -46,7 +46,7 @@ function JitsiLocalTrack(stream, track, mediaType, videoType, resolution,
46 46
     // FIXME: currently firefox is ignoring our constraints about resolutions
47 47
     // so we do not store it, to avoid wrong reporting of local track resolution
48 48
     if (RTCBrowserType.isFirefox())
49
-        this.resolution = null;
49
+        {this.resolution = null;}
50 50
 
51 51
     this.deviceId = deviceId;
52 52
     this.startMuted = false;
@@ -183,7 +183,7 @@ JitsiLocalTrack.prototype._clearNoDataFromSourceMuteResources = function () {
183 183
 JitsiLocalTrack.prototype._onNoDataFromSourceError = function () {
184 184
     this._clearNoDataFromSourceMuteResources();
185 185
     if(this._checkForCameraIssues())
186
-        this._fireNoDataFromSourceEvent();
186
+        {this._fireNoDataFromSourceEvent();}
187 187
 };
188 188
 
189 189
 /**
@@ -293,7 +293,7 @@ JitsiLocalTrack.prototype._setMute = function (mute) {
293 293
         this.videoType === VideoType.DESKTOP ||
294 294
         RTCBrowserType.isFirefox()) {
295 295
         if(this.track)
296
-            this.track.enabled = !mute;
296
+            {this.track.enabled = !mute;}
297 297
     } else {
298 298
         if(mute) {
299 299
             this.dontFireRemoveEvent = true;
@@ -316,7 +316,7 @@ JitsiLocalTrack.prototype._setMute = function (mute) {
316 316
                 facingMode: this.getCameraFacingMode()
317 317
             };
318 318
             if (this.resolution)
319
-                streamOptions.resolution = this.resolution;
319
+                {streamOptions.resolution = this.resolution;}
320 320
 
321 321
             promise = RTCUtils.obtainAudioAndVideoPermissions(streamOptions)
322 322
                 .then(function (streamsInfo) {
@@ -475,7 +475,7 @@ JitsiLocalTrack.prototype.dispose = function () {
475 475
 JitsiLocalTrack.prototype.isMuted = function () {
476 476
     // this.stream will be null when we mute local video on Chrome
477 477
     if (!this.stream)
478
-        return true;
478
+        {return true;}
479 479
     if (this.isVideoTrack() && !this.isActive()) {
480 480
         return true;
481 481
     } else {
@@ -519,11 +519,11 @@ JitsiLocalTrack.prototype._setConference = function(conference) {
519 519
  */
520 520
 JitsiLocalTrack.prototype.getSSRC = function () {
521 521
     if(this.ssrc && this.ssrc.groups && this.ssrc.groups.length)
522
-        return this.ssrc.groups[0].ssrcs[0];
522
+        {return this.ssrc.groups[0].ssrcs[0];}
523 523
     else if(this.ssrc && this.ssrc.ssrcs && this.ssrc.ssrcs.length)
524
-        return this.ssrc.ssrcs[0];
524
+        {return this.ssrc.ssrcs[0];}
525 525
     else
526
-        return null;
526
+        {return null;}
527 527
 };
528 528
 
529 529
 /**
@@ -622,7 +622,7 @@ JitsiLocalTrack.prototype._stopMediaStream = function () {
622 622
 JitsiLocalTrack.prototype._checkForCameraIssues = function () {
623 623
     if(!this.isVideoTrack() || this.stopStreamInProgress ||
624 624
         this.videoType === VideoType.DESKTOP)
625
-        return false;
625
+        {return false;}
626 626
 
627 627
     return !this._isReceivingData();
628 628
 };
@@ -638,7 +638,7 @@ JitsiLocalTrack.prototype._checkForCameraIssues = function () {
638 638
  */
639 639
 JitsiLocalTrack.prototype._isReceivingData = function () {
640 640
     if(!this.stream)
641
-        return false;
641
+        {return false;}
642 642
     // In older version of the spec there is no muted property and
643 643
     // readyState can have value muted. In the latest versions
644 644
     // readyState can have values "live" and "ended" and there is

+ 9
- 9
modules/RTC/JitsiRemoteTrack.js Voir le fichier

@@ -38,7 +38,7 @@ function JitsiRemoteTrack(rtc, conference, ownerEndpointId, stream, track,
38 38
     this.hasBeenMuted = muted;
39 39
     // Bind 'onmute' and 'onunmute' event handlers
40 40
     if (this.rtc && this.track)
41
-        this._bindMuteHandlers();
41
+        {this._bindMuteHandlers();}
42 42
 }
43 43
 
44 44
 JitsiRemoteTrack.prototype = Object.create(JitsiTrack.prototype);
@@ -77,14 +77,14 @@ JitsiRemoteTrack.prototype._bindMuteHandlers = function() {
77 77
  */
78 78
 JitsiRemoteTrack.prototype.setMute = function (value) {
79 79
     if(this.muted === value)
80
-        return;
80
+        {return;}
81 81
 
82 82
     if(value)
83
-        this.hasBeenMuted = true;
83
+        {this.hasBeenMuted = true;}
84 84
 
85 85
     // we can have a fake video stream
86 86
     if(this.stream)
87
-        this.stream.muted = value;
87
+        {this.stream.muted = value;}
88 88
 
89 89
     this.muted = value;
90 90
     this.eventEmitter.emit(JitsiTrackEvents.TRACK_MUTE_CHANGED, this);
@@ -129,7 +129,7 @@ JitsiRemoteTrack.prototype.getSSRC = function () {
129 129
  */
130 130
 JitsiRemoteTrack.prototype._setVideoType = function (type) {
131 131
     if(this.videoType === type)
132
-        return;
132
+        {return;}
133 133
     this.videoType = type;
134 134
     this.eventEmitter.emit(JitsiTrackEvents.TRACK_VIDEOTYPE_CHANGED, type);
135 135
 };
@@ -150,7 +150,7 @@ JitsiRemoteTrack.prototype._playCallback = function () {
150 150
     console.log("(TIME) TTFM " + type + ":\t", ttfm);
151 151
     var eventName = type +'.ttfm';
152 152
     if(this.hasBeenMuted)
153
-        eventName += '.muted';
153
+        {eventName += '.muted';}
154 154
     Statistics.analytics.sendEvent(eventName, {value: ttfm});
155 155
 };
156 156
 
@@ -165,12 +165,12 @@ JitsiRemoteTrack.prototype._playCallback = function () {
165 165
 JitsiRemoteTrack.prototype._attachTTFMTracker = function (container) {
166 166
     if((ttfmTrackerAudioAttached && this.isAudioTrack())
167 167
         || (ttfmTrackerVideoAttached && this.isVideoTrack()))
168
-        return;
168
+        {return;}
169 169
 
170 170
     if (this.isAudioTrack())
171
-        ttfmTrackerAudioAttached = true;
171
+        {ttfmTrackerAudioAttached = true;}
172 172
     if (this.isVideoTrack())
173
-        ttfmTrackerVideoAttached = true;
173
+        {ttfmTrackerVideoAttached = true;}
174 174
 
175 175
     if (RTCBrowserType.isTemasysPluginUsed()) {
176 176
         // XXX Don't require Temasys unless it's to be used because it doesn't

+ 10
- 10
modules/RTC/JitsiTrack.js Voir le fichier

@@ -27,7 +27,7 @@ function implementOnEndedHandling(jitsiTrack) {
27 27
     var stream = jitsiTrack.getOriginalStream();
28 28
 
29 29
     if(!stream)
30
-        return;
30
+        {return;}
31 31
 
32 32
     var originalStop = stream.stop;
33 33
     stream.stop = function () {
@@ -46,9 +46,9 @@ function implementOnEndedHandling(jitsiTrack) {
46 46
 function addMediaStreamInactiveHandler(mediaStream, handler) {
47 47
     // Temasys will use onended
48 48
     if(typeof mediaStream.active !== "undefined")
49
-        mediaStream.oninactive = handler;
49
+        {mediaStream.oninactive = handler;}
50 50
     else
51
-        mediaStream.onended = handler;
51
+        {mediaStream.onended = handler;}
52 52
 }
53 53
 
54 54
 /**
@@ -102,7 +102,7 @@ function JitsiTrack(conference, stream, track, streamInactiveHandler, trackMedia
102 102
 JitsiTrack.prototype._setHandler = function (type, handler) {
103 103
     this.handlers[type] = handler;
104 104
     if(!this.stream)
105
-        return;
105
+        {return;}
106 106
 
107 107
     if(type === "inactive") {
108 108
         if (RTCBrowserType.isFirefox()) {
@@ -316,9 +316,9 @@ JitsiTrack.prototype.isScreenSharing = function() {
316 316
  */
317 317
 JitsiTrack.prototype.getId = function () {
318 318
     if(this.stream)
319
-        return RTCUtils.getStreamID(this.stream);
319
+        {return RTCUtils.getStreamID(this.stream);}
320 320
     else
321
-        return null;
321
+        {return null;}
322 322
 };
323 323
 
324 324
 /**
@@ -329,9 +329,9 @@ JitsiTrack.prototype.getId = function () {
329 329
  */
330 330
 JitsiTrack.prototype.isActive = function () {
331 331
     if(typeof this.stream.active !== "undefined")
332
-        return this.stream.active;
332
+        {return this.stream.active;}
333 333
     else
334
-        return true;
334
+        {return true;}
335 335
 };
336 336
 
337 337
 /**
@@ -342,7 +342,7 @@ JitsiTrack.prototype.isActive = function () {
342 342
  */
343 343
 JitsiTrack.prototype.on = function (eventId, handler) {
344 344
     if(this.eventEmitter)
345
-        this.eventEmitter.on(eventId, handler);
345
+        {this.eventEmitter.on(eventId, handler);}
346 346
 };
347 347
 
348 348
 /**
@@ -352,7 +352,7 @@ JitsiTrack.prototype.on = function (eventId, handler) {
352 352
  */
353 353
 JitsiTrack.prototype.off = function (eventId, handler) {
354 354
     if(this.eventEmitter)
355
-        this.eventEmitter.removeListener(eventId, handler);
355
+        {this.eventEmitter.removeListener(eventId, handler);}
356 356
 };
357 357
 
358 358
 // Common aliases for event emitter

+ 5
- 5
modules/RTC/RTC.js Voir le fichier

@@ -165,7 +165,7 @@ export default class RTC extends Listenable {
165 165
         // cache the value if channel is missing, till we open it
166 166
         this.selectedEndpoint = id;
167 167
         if(this.dataChannels && this.dataChannelsOpen)
168
-            this.dataChannels.sendSelectedEndpointMessage(id);
168
+            {this.dataChannels.sendSelectedEndpointMessage(id);}
169 169
     }
170 170
 
171 171
     /**
@@ -253,7 +253,7 @@ export default class RTC extends Listenable {
253 253
 
254 254
     addLocalTrack (track) {
255 255
         if (!track)
256
-            throw new Error('track must not be null nor undefined');
256
+            {throw new Error('track must not be null nor undefined');}
257 257
 
258 258
         this.localTracks.push(track);
259 259
 
@@ -331,9 +331,9 @@ export default class RTC extends Listenable {
331 331
      */
332 332
     getRemoteTrackByType (type, resource) {
333 333
         if (this.remoteTracks[resource])
334
-            return this.remoteTracks[resource][type];
334
+            {return this.remoteTracks[resource][type];}
335 335
         else
336
-            return null;
336
+            {return null;}
337 337
     }
338 338
 
339 339
     /**
@@ -633,7 +633,7 @@ export default class RTC extends Listenable {
633 633
 
634 634
     setAudioLevel (resource, audioLevel) {
635 635
         if(!resource)
636
-            return;
636
+            {return;}
637 637
         var audioTrack = this.getRemoteAudioTrack(resource);
638 638
         if(audioTrack) {
639 639
             audioTrack.setAudioLevel(audioLevel);

+ 1
- 1
modules/RTC/RTCBrowserType.js Voir le fichier

@@ -336,7 +336,7 @@ function detectBrowser() {
336 336
     for (var i = 0; i < detectors.length; i++) {
337 337
         version = detectors[i]();
338 338
         if (version)
339
-            return version;
339
+            {return version;}
340 340
     }
341 341
     logger.warn("Browser type defaults to Safari ver 1");
342 342
     currentBrowser = RTCBrowserType.RTC_BROWSER_SAFARI;

+ 6
- 6
modules/RTC/RTCUtils.js Voir le fichier

@@ -117,11 +117,11 @@ function setResolutionConstraints(constraints, resolution) {
117 117
     }
118 118
 
119 119
     if (constraints.video.mandatory.minWidth)
120
-        constraints.video.mandatory.maxWidth =
121
-            constraints.video.mandatory.minWidth;
120
+        {constraints.video.mandatory.maxWidth =
121
+            constraints.video.mandatory.minWidth;}
122 122
     if (constraints.video.mandatory.minHeight)
123
-        constraints.video.mandatory.maxHeight =
124
-            constraints.video.mandatory.minHeight;
123
+        {constraints.video.mandatory.maxHeight =
124
+            constraints.video.mandatory.minHeight;}
125 125
 }
126 126
 
127 127
 /**
@@ -772,7 +772,7 @@ class RTCUtils extends Listenable {
772 772
                     if (element) {
773 773
                         defaultSetVideoSrc(element, stream);
774 774
                         if (stream)
775
-                            element.play();
775
+                            {element.play();}
776 776
                     }
777 777
                     return element;
778 778
                 });
@@ -1146,7 +1146,7 @@ class RTCUtils extends Listenable {
1146 1146
 
1147 1147
     _isDeviceListAvailable () {
1148 1148
         if (!rtcReady)
1149
-            throw new Error("WebRTC not ready yet");
1149
+            {throw new Error("WebRTC not ready yet");}
1150 1150
         var isEnumerateDevicesAvailable
1151 1151
             = navigator.mediaDevices && navigator.mediaDevices.enumerateDevices;
1152 1152
         if (isEnumerateDevicesAvailable) {

+ 5
- 5
modules/RTC/ScreenObtainer.js Voir le fichier

@@ -74,7 +74,7 @@ var ScreenObtainer = {
74 74
         gumFunction = gum;
75 75
 
76 76
         if (RTCBrowserType.isFirefox())
77
-            initFirefoxExtensionDetection(options);
77
+            {initFirefoxExtensionDetection(options);}
78 78
 
79 79
         if (RTCBrowserType.isNWJS()) {
80 80
             obtainDesktopStream = (options, onSuccess, onFailure) => {
@@ -207,7 +207,7 @@ var ScreenObtainer = {
207 207
             window.setTimeout(
208 208
                 () => {
209 209
                     if (firefoxExtInstalled === null)
210
-                        firefoxExtInstalled = false;
210
+                        {firefoxExtInstalled = false;}
211 211
                     this.obtainScreenOnFirefox(callback, errorCallback);
212 212
                 },
213 213
                 300);
@@ -354,9 +354,9 @@ function isUpdateRequired(minVersion, extVersion) {
354 354
                 n2 = 0;
355 355
 
356 356
             if (i < s1.length)
357
-                n1 = parseInt(s1[i]);
357
+                {n1 = parseInt(s1[i]);}
358 358
             if (i < s2.length)
359
-                n2 = parseInt(s2[i]);
359
+                {n2 = parseInt(s2[i]);}
360 360
 
361 361
             if (isNaN(n1) || isNaN(n2)) {
362 362
                 return true;
@@ -534,7 +534,7 @@ function initFirefoxExtensionDetection(options) {
534 534
         return;
535 535
     }
536 536
     if (firefoxExtInstalled === false || firefoxExtInstalled === true)
537
-        return;
537
+        {return;}
538 538
     if (!options.desktopSharingFirefoxExtId) {
539 539
         firefoxExtInstalled = false;
540 540
         return;

+ 2
- 2
modules/RTC/TraceablePeerConnection.js Voir le fichier

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

+ 3
- 3
modules/TalkMutedDetection.js Voir le fichier

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

+ 2
- 2
modules/statistics/CallStats.js Voir le fichier

@@ -213,7 +213,7 @@ CallStats.feedbackEnabled = false;
213 213
 CallStats._checkInitialize = function () {
214 214
     if (CallStats.initialized || !CallStats.initializeFailed
215 215
         || !callStats || CallStats.initializeInProgress)
216
-        return;
216
+        {return;}
217 217
 
218 218
     // callstats object created, not initialized and it had previously failed,
219 219
     // and there is no init in progress, so lets try initialize it again
@@ -237,7 +237,7 @@ var reportType = {
237 237
 
238 238
 CallStats.prototype.pcCallback = _try_catch(function (err, msg) {
239 239
     if (callStats && err !== 'success')
240
-        logger.error("Monitoring status: "+ err + " msg: " + msg);
240
+        {logger.error("Monitoring status: "+ err + " msg: " + msg);}
241 241
 });
242 242
 
243 243
 /**

+ 2
- 2
modules/statistics/LocalStatsCollector.js Voir le fichier

@@ -47,7 +47,7 @@ function timeDomainDataToAudioLevel(samples) {
47 47
 
48 48
     for (var i = 0; i < length; i++) {
49 49
         if (maxVolume < samples[i])
50
-            maxVolume = samples[i];
50
+            {maxVolume = samples[i];}
51 51
     }
52 52
 
53 53
     return parseFloat(((maxVolume - 127) / 128).toFixed(3));
@@ -98,7 +98,7 @@ function LocalStatsCollector(stream, interval, callback) {
98 98
 LocalStatsCollector.prototype.start = function () {
99 99
     if (!context ||
100 100
         RTCBrowserType.isTemasysPluginUsed())
101
-        return;
101
+        {return;}
102 102
     context.resume();
103 103
     var analyser = context.createAnalyser();
104 104
     analyser.smoothingTimeConstant = WEBAUDIO_ANALYZER_SMOOTING_TIME;

+ 9
- 9
modules/statistics/RTPStatsCollector.js Voir le fichier

@@ -65,7 +65,7 @@ KEYS_BY_BROWSER_TYPE[RTCBrowserType.RTC_BROWSER_REACT_NATIVE] =
65 65
  */
66 66
 function calculatePacketLoss(lostPackets, totalPackets) {
67 67
     if(!totalPackets || totalPackets <= 0 || !lostPackets || lostPackets <= 0)
68
-        return 0;
68
+        {return 0;}
69 69
     return Math.round((lostPackets/totalPackets)*100);
70 70
 }
71 71
 
@@ -180,7 +180,7 @@ function StatsCollector(
180 180
     this._browserType = RTCBrowserType.getBrowserType();
181 181
     var keys = KEYS_BY_BROWSER_TYPE[this._browserType];
182 182
     if (!keys)
183
-        throw "The browser type '" + this._browserType + "' isn't supported!";
183
+        {throw "The browser type '" + this._browserType + "' isn't supported!";}
184 184
     /**
185 185
      * The function which is to be used to retrieve the value associated in a
186 186
      * report returned by RTCPeerConnection#getStats with a LibJitsiMeet
@@ -316,9 +316,9 @@ StatsCollector.prototype._defineGetStatValueMethod = function (keys) {
316 316
     var keyFromName = function (name) {
317 317
         var key = keys[name];
318 318
         if (key)
319
-            return key;
319
+            {return key;}
320 320
         else
321
-            throw "The property '" + name + "' isn't supported!";
321
+            {throw "The property '" + name + "' isn't supported!";}
322 322
     };
323 323
 
324 324
     // Define the function which retrieves the value from a specific report
@@ -416,7 +416,7 @@ StatsCollector.prototype.processStatsReport = function () {
416 416
             }
417 417
             catch(e){/*not supported*/}
418 418
             if(!ip || !type || !localip || active != "true")
419
-                continue;
419
+                {continue;}
420 420
             // Save the address unless it has been saved already.
421 421
             var conferenceStatsTransport = this.conferenceStats.transport;
422 422
             if(!conferenceStatsTransport.some(function (t) { return (
@@ -430,7 +430,7 @@ StatsCollector.prototype.processStatsReport = function () {
430 430
 
431 431
         if(now.type == "candidatepair") {
432 432
             if(now.state == "succeeded")
433
-                continue;
433
+                {continue;}
434 434
 
435 435
             var local = this.currentStatsReport[now.localCandidateId];
436 436
             var remote = this.currentStatsReport[now.remoteCandidateId];
@@ -469,7 +469,7 @@ StatsCollector.prototype.processStatsReport = function () {
469 469
             }
470 470
         }
471 471
         if (!packetsNow || packetsNow < 0)
472
-            packetsNow = 0;
472
+            {packetsNow = 0;}
473 473
 
474 474
         var packetsBefore = getNonNegativeStat(before, key);
475 475
         var packetsDiff = Math.max(0, packetsNow - packetsBefore);
@@ -612,7 +612,7 @@ StatsCollector.prototype.processAudioLevelReport = function () {
612 612
         var now = this.currentAudioLevelsReport[idx];
613 613
 
614 614
         if (now.type != 'ssrc')
615
-            continue;
615
+            {continue;}
616 616
 
617 617
         var before = this.baselineAudioLevelsReport[idx];
618 618
         var ssrc = getStatValue(now, 'ssrc');
@@ -623,7 +623,7 @@ StatsCollector.prototype.processAudioLevelReport = function () {
623 623
 
624 624
         if (!ssrc) {
625 625
             if ((Date.now() - now.timestamp) < 3000)
626
-                logger.warn("No ssrc: ");
626
+                {logger.warn("No ssrc: ");}
627 627
             continue;
628 628
         }
629 629
 

+ 19
- 19
modules/statistics/statistics.js Voir le fichier

@@ -90,7 +90,7 @@ function Statistics(xmpp, options) {
90 90
             // requests to any third parties.
91 91
             && (Statistics.disableThirdPartyRequests !== true);
92 92
     if(this.callStatsIntegrationEnabled)
93
-        loadCallStatsAPI(this.options.callStatsCustomScriptUrl);
93
+        {loadCallStatsAPI(this.options.callStatsCustomScriptUrl);}
94 94
     this.callStats = null;
95 95
     // Flag indicates whether or not the CallStats have been started for this
96 96
     // Statistics instance
@@ -125,7 +125,7 @@ Statistics.localStats = [];
125 125
 
126 126
 Statistics.startLocalStats = function (stream, callback) {
127 127
     if(!Statistics.audioLevelsEnabled)
128
-        return;
128
+        {return;}
129 129
     var localStats = new LocalStats(stream, Statistics.audioLevelsInterval,
130 130
         callback);
131 131
     this.localStats.push(localStats);
@@ -134,13 +134,13 @@ Statistics.startLocalStats = function (stream, callback) {
134 134
 
135 135
 Statistics.prototype.addAudioLevelListener = function(listener) {
136 136
     if(!Statistics.audioLevelsEnabled)
137
-        return;
137
+        {return;}
138 138
     this.eventEmitter.on(StatisticsEvents.AUDIO_LEVEL, listener);
139 139
 };
140 140
 
141 141
 Statistics.prototype.removeAudioLevelListener = function(listener) {
142 142
     if(!Statistics.audioLevelsEnabled)
143
-        return;
143
+        {return;}
144 144
     this.eventEmitter.removeListener(StatisticsEvents.AUDIO_LEVEL, listener);
145 145
 };
146 146
 
@@ -177,19 +177,19 @@ Statistics.prototype.dispose = function () {
177 177
     this.stopCallStats();
178 178
     this.stopRemoteStats();
179 179
     if(this.eventEmitter)
180
-        this.eventEmitter.removeAllListeners();
180
+        {this.eventEmitter.removeAllListeners();}
181 181
 };
182 182
 
183 183
 Statistics.stopLocalStats = function (stream) {
184 184
     if(!Statistics.audioLevelsEnabled)
185
-        return;
185
+        {return;}
186 186
 
187 187
     for(var i = 0; i < Statistics.localStats.length; i++)
188
-        if(Statistics.localStats[i].stream === stream){
188
+        {if(Statistics.localStats[i].stream === stream){
189 189
             var localStats = Statistics.localStats.splice(i, 1);
190 190
             localStats[0].stop();
191 191
             break;
192
-        }
192
+        }}
193 193
 };
194 194
 
195 195
 Statistics.prototype.stopRemoteStats = function () {
@@ -224,7 +224,7 @@ Statistics.prototype.stopCallStats = function () {
224 224
     if(this.callStatsStarted) {
225 225
         var index = Statistics.callsStatsInstances.indexOf(this.callstats);
226 226
         if(index > -1)
227
-            Statistics.callsStatsInstances.splice(index, 1);
227
+            {Statistics.callsStatsInstances.splice(index, 1);}
228 228
         // The next line is commented because we need to be able to send
229 229
         // feedback even after the conference has been destroyed.
230 230
         // this.callstats = null;
@@ -250,7 +250,7 @@ Statistics.prototype.isCallstatsEnabled = function () {
250 250
  */
251 251
 Statistics.prototype.sendIceConnectionFailedEvent = function (pc) {
252 252
     if(this.callstats)
253
-        this.callstats.sendIceConnectionFailedEvent(pc, this.callstats);
253
+        {this.callstats.sendIceConnectionFailedEvent(pc, this.callstats);}
254 254
     Statistics.analytics.sendEvent('connection.ice_failed');
255 255
 };
256 256
 
@@ -261,7 +261,7 @@ Statistics.prototype.sendIceConnectionFailedEvent = function (pc) {
261 261
  */
262 262
 Statistics.prototype.sendMuteEvent = function (muted, type) {
263 263
     if(this.callstats)
264
-        CallStats.sendMuteEvent(muted, type, this.callstats);
264
+        {CallStats.sendMuteEvent(muted, type, this.callstats);}
265 265
 };
266 266
 
267 267
 /**
@@ -271,7 +271,7 @@ Statistics.prototype.sendMuteEvent = function (muted, type) {
271 271
  */
272 272
 Statistics.prototype.sendScreenSharingEvent = function (start) {
273 273
     if(this.callstats)
274
-        CallStats.sendScreenSharingEvent(start, this.callstats);
274
+        {CallStats.sendScreenSharingEvent(start, this.callstats);}
275 275
 };
276 276
 
277 277
 /**
@@ -280,7 +280,7 @@ Statistics.prototype.sendScreenSharingEvent = function (start) {
280 280
  */
281 281
 Statistics.prototype.sendDominantSpeakerEvent = function () {
282 282
     if(this.callstats)
283
-        CallStats.sendDominantSpeakerEvent(this.callstats);
283
+        {CallStats.sendDominantSpeakerEvent(this.callstats);}
284 284
 };
285 285
 
286 286
 /**
@@ -349,7 +349,7 @@ Statistics.sendGetUserMediaFailed = function (e) {
349 349
  */
350 350
 Statistics.prototype.sendCreateOfferFailed = function (e, pc) {
351 351
     if(this.callstats)
352
-        CallStats.sendCreateOfferFailed(e, pc, this.callstats);
352
+        {CallStats.sendCreateOfferFailed(e, pc, this.callstats);}
353 353
 };
354 354
 
355 355
 /**
@@ -360,7 +360,7 @@ Statistics.prototype.sendCreateOfferFailed = function (e, pc) {
360 360
  */
361 361
 Statistics.prototype.sendCreateAnswerFailed = function (e, pc) {
362 362
     if(this.callstats)
363
-        CallStats.sendCreateAnswerFailed(e, pc, this.callstats);
363
+        {CallStats.sendCreateAnswerFailed(e, pc, this.callstats);}
364 364
 };
365 365
 
366 366
 /**
@@ -371,7 +371,7 @@ Statistics.prototype.sendCreateAnswerFailed = function (e, pc) {
371 371
  */
372 372
 Statistics.prototype.sendSetLocalDescFailed = function (e, pc) {
373 373
     if(this.callstats)
374
-        CallStats.sendSetLocalDescFailed(e, pc, this.callstats);
374
+        {CallStats.sendSetLocalDescFailed(e, pc, this.callstats);}
375 375
 };
376 376
 
377 377
 /**
@@ -382,7 +382,7 @@ Statistics.prototype.sendSetLocalDescFailed = function (e, pc) {
382 382
  */
383 383
 Statistics.prototype.sendSetRemoteDescFailed = function (e, pc) {
384 384
     if(this.callstats)
385
-        CallStats.sendSetRemoteDescFailed(e, pc, this.callstats);
385
+        {CallStats.sendSetRemoteDescFailed(e, pc, this.callstats);}
386 386
 };
387 387
 
388 388
 /**
@@ -393,7 +393,7 @@ Statistics.prototype.sendSetRemoteDescFailed = function (e, pc) {
393 393
  */
394 394
 Statistics.prototype.sendAddIceCandidateFailed = function (e, pc) {
395 395
     if(this.callstats)
396
-        CallStats.sendAddIceCandidateFailed(e, pc, this.callstats);
396
+        {CallStats.sendAddIceCandidateFailed(e, pc, this.callstats);}
397 397
 };
398 398
 
399 399
 /**
@@ -419,7 +419,7 @@ Statistics.sendLog = function (m) {
419 419
  */
420 420
 Statistics.prototype.sendFeedback = function(overall, detailed) {
421 421
     if(this.callstats)
422
-        this.callstats.sendFeedback(overall, detailed);
422
+        {this.callstats.sendFeedback(overall, detailed);}
423 423
     Statistics.analytics.sendEvent("feedback.rating",
424 424
         {value: overall, detailed: detailed});
425 425
 };

+ 1
- 1
modules/util/EventEmitterForwarder.js Voir le fichier

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

+ 4
- 4
modules/util/GlobalOnErrorHandler.js Voir le fichier

@@ -23,7 +23,7 @@ function JitsiGlobalErrorHandler(message, source, lineno, colno, error) {
23 23
         handler(message, source, lineno, colno, error);
24 24
     });
25 25
     if (oldOnErrorHandler)
26
-        oldOnErrorHandler(message, source, lineno, colno, error);
26
+        {oldOnErrorHandler(message, source, lineno, colno, error);}
27 27
 }
28 28
 
29 29
 // If an old handler exists, also fire its events.
@@ -38,7 +38,7 @@ function JitsiGlobalUnhandledRejection(event) {
38 38
         handler(null, null, null, null, event.reason);
39 39
     });
40 40
     if(oldOnUnhandledRejection)
41
-        oldOnUnhandledRejection(event);
41
+        {oldOnUnhandledRejection(event);}
42 42
 }
43 43
 
44 44
 // Setting the custom error handlers.
@@ -61,7 +61,7 @@ var GlobalOnErrorHandler = {
61 61
     callErrorHandler: function (error) {
62 62
         var errHandler = window.onerror;
63 63
         if(!errHandler)
64
-            return;
64
+            {return;}
65 65
         errHandler(null, null, null, null, error);
66 66
     },
67 67
     /**
@@ -71,7 +71,7 @@ var GlobalOnErrorHandler = {
71 71
     callUnhandledRejectionHandler: function (error) {
72 72
         var errHandler = window.onunhandledrejection;
73 73
         if(!errHandler)
74
-            return;
74
+            {return;}
75 75
         errHandler(error);
76 76
     }
77 77
 };

+ 3
- 3
modules/util/ScriptUtil.js Voir le fichier

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

+ 1
- 1
modules/version/ComponentsVersions.js Voir le fichier

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

+ 17
- 17
modules/xmpp/ChatRoom.js Voir le fichier

@@ -38,9 +38,9 @@ var parser = {
38 38
             }
39 39
             packet.c(node.tagName, node.attributes);
40 40
             if(node.value)
41
-                packet.t(node.value);
41
+                {packet.t(node.value);}
42 42
             if(node.children)
43
-                this.json2packet(node.children, packet);
43
+                {this.json2packet(node.children, packet);}
44 44
             packet.up();
45 45
         }
46 46
         // packet.up();
@@ -55,8 +55,8 @@ var parser = {
55 55
 function filterNodeFromPresenceJSON(pres, nodeName){
56 56
     var res = [];
57 57
     for(let i = 0; i < pres.length; i++)
58
-        if(pres[i].tagName === nodeName)
59
-            res.push(pres[i]);
58
+        {if(pres[i].tagName === nodeName)
59
+            {res.push(pres[i]);}}
60 60
 
61 61
     return res;
62 62
 }
@@ -303,7 +303,7 @@ export default class ChatRoom extends Listenable {
303 303
 
304 304
                 // set correct initial state of locked
305 305
                 if (this.password)
306
-                    this.locked = true;
306
+                    {this.locked = true;}
307 307
 
308 308
                 this.eventEmitter.emit(XMPPEvents.MUC_JOINED);
309 309
             }
@@ -343,7 +343,7 @@ export default class ChatRoom extends Listenable {
343 343
 
344 344
             // store the new display name
345 345
             if(member.displayName)
346
-                memberOfThis.displayName = member.displayName;
346
+                {memberOfThis.displayName = member.displayName;}
347 347
         }
348 348
 
349 349
         // after we had fired member or room joined events, lets fire events
@@ -376,7 +376,7 @@ export default class ChatRoom extends Listenable {
376 376
                 case "call-control":
377 377
                     var att = node.attributes;
378 378
                     if(!att)
379
-                        break;
379
+                        {break;}
380 380
                     this.phoneNumber = att.phone || null;
381 381
                     this.phonePin = att.pin || null;
382 382
                     this.eventEmitter.emit(XMPPEvents.PHONE_NUMBER_CHANGED);
@@ -395,7 +395,7 @@ export default class ChatRoom extends Listenable {
395 395
         {
396 396
             this.lastJibri = jibri;
397 397
             if(this.recording)
398
-                this.recording.handleJibriPresence(jibri);
398
+                {this.recording.handleJibriPresence(jibri);}
399 399
         }
400 400
     }
401 401
 
@@ -411,7 +411,7 @@ export default class ChatRoom extends Listenable {
411 411
                 this.eventEmitter, this.connection, this.focusMucJid,
412 412
                 this.options.jirecon, this.roomjid);
413 413
             if(this.lastJibri)
414
-                this.recording.handleJibriPresence(this.lastJibri);
414
+                {this.recording.handleJibriPresence(this.lastJibri);}
415 415
         }
416 416
         logger.info("Ignore focus: " + from + ", real JID: " + mucJid);
417 417
     }
@@ -469,7 +469,7 @@ export default class ChatRoom extends Listenable {
469 469
         delete this.lastPresences[jid];
470 470
 
471 471
         if(skipEvents)
472
-            return;
472
+            {return;}
473 473
 
474 474
         this.eventEmitter.emit(XMPPEvents.MUC_MEMBER_LEFT, jid);
475 475
 
@@ -520,7 +520,7 @@ export default class ChatRoom extends Listenable {
520 520
             // we fire muc_left only if this is not a kick,
521 521
             // kick has both statuses 110 and 307.
522 522
             if (!isKick)
523
-                this.eventEmitter.emit(XMPPEvents.MUC_LEFT);
523
+                {this.eventEmitter.emit(XMPPEvents.MUC_LEFT);}
524 524
         }
525 525
 
526 526
         if (isKick && this.myroomjid === from) {
@@ -694,7 +694,7 @@ export default class ChatRoom extends Listenable {
694 694
     setVideoMute (mute, callback) {
695 695
         this.sendVideoInfoPresence(mute);
696 696
         if(callback)
697
-            callback(mute);
697
+            {callback(mute);}
698 698
     }
699 699
 
700 700
     setAudioMute (mute, callback) {
@@ -715,7 +715,7 @@ export default class ChatRoom extends Listenable {
715 715
             this.sendPresence();
716 716
         }
717 717
         if(callback)
718
-            callback();
718
+            {callback();}
719 719
     }
720 720
 
721 721
     addVideoInfoToPresence (mute) {
@@ -729,7 +729,7 @@ export default class ChatRoom extends Listenable {
729 729
     sendVideoInfoPresence (mute) {
730 730
         this.addVideoInfoToPresence(mute);
731 731
         if(!this.connection)
732
-            return;
732
+            {return;}
733 733
         this.sendPresence();
734 734
     }
735 735
 
@@ -781,7 +781,7 @@ export default class ChatRoom extends Listenable {
781 781
      */
782 782
     isRecordingSupported () {
783 783
         if(this.recording)
784
-            return this.recording.isSupported();
784
+            {return this.recording.isSupported();}
785 785
         return false;
786 786
     }
787 787
 
@@ -807,7 +807,7 @@ export default class ChatRoom extends Listenable {
807 807
      */
808 808
     toggleRecording (options, statusChangeHandler) {
809 809
         if(this.recording)
810
-            return this.recording.toggleRecording(options, statusChangeHandler);
810
+            {return this.recording.toggleRecording(options, statusChangeHandler);}
811 811
 
812 812
         return statusChangeHandler("error",
813 813
             new Error("The conference is not created yet!"));
@@ -818,7 +818,7 @@ export default class ChatRoom extends Listenable {
818 818
      */
819 819
     isSIPCallingSupported () {
820 820
         if(this.moderator)
821
-            return this.moderator.isSipGatewayEnabled();
821
+            {return this.moderator.isSipGatewayEnabled();}
822 822
         return false;
823 823
     }
824 824
 

+ 17
- 17
modules/xmpp/JingleSessionPC.js Voir le fichier

@@ -131,10 +131,10 @@ export default class JingleSessionPC extends JingleSession {
131 131
                     protocol = protocol.toLowerCase();
132 132
                     if (protocol === 'tcp' || protocol === 'ssltcp') {
133 133
                         if (this.webrtcIceTcpDisable)
134
-                            return;
134
+                            {return;}
135 135
                     } else if (protocol == 'udp') {
136 136
                         if (this.webrtcIceUdpDisable)
137
-                            return;
137
+                            {return;}
138 138
                     }
139 139
                 }
140 140
             }
@@ -148,7 +148,7 @@ export default class JingleSessionPC extends JingleSession {
148 148
         // "closed" instead.
149 149
         // I suppose at some point this will be moved to onconnectionstatechange
150 150
         this.peerconnection.onsignalingstatechange = () => {
151
-            if (!this.peerconnection) return;
151
+            if (!this.peerconnection) {return;}
152 152
             if (this.peerconnection.signalingState === 'stable') {
153 153
                 this.wasstable = true;
154 154
             } else if (
@@ -165,7 +165,7 @@ export default class JingleSessionPC extends JingleSession {
165 165
          * the value of RTCPeerConnection.iceConnectionState changes.
166 166
          */
167 167
         this.peerconnection.oniceconnectionstatechange = () => {
168
-            if (!this.peerconnection) return;
168
+            if (!this.peerconnection) {return;}
169 169
             const now = window.performance.now();
170 170
             this.room.connectionTimes["ice.state." +
171 171
             this.peerconnection.iceConnectionState] = now;
@@ -190,13 +190,13 @@ export default class JingleSessionPC extends JingleSession {
190 190
                     break;
191 191
                 case 'disconnected':
192 192
                     if (this.closed)
193
-                        break;
193
+                        {break;}
194 194
                     this.isreconnect = true;
195 195
                     // Informs interested parties that the connection has been
196 196
                     // interrupted.
197 197
                     if (this.wasstable)
198
-                        this.room.eventEmitter.emit(
199
-                            XMPPEvents.CONNECTION_INTERRUPTED);
198
+                        {this.room.eventEmitter.emit(
199
+                            XMPPEvents.CONNECTION_INTERRUPTED);}
200 200
                     break;
201 201
                 case 'failed':
202 202
                     this.room.eventEmitter.emit(
@@ -228,7 +228,7 @@ export default class JingleSessionPC extends JingleSession {
228 228
                 if (this.drip_container.length === 0) {
229 229
                     // start 20ms callout
230 230
                     setTimeout(() => {
231
-                        if (this.drip_container.length === 0) return;
231
+                        if (this.drip_container.length === 0) {return;}
232 232
                         this.sendIceCandidates(this.drip_container);
233 233
                         this.drip_container = [];
234 234
                     }, 20);
@@ -659,13 +659,13 @@ export default class JingleSessionPC extends JingleSession {
659 659
                 $(this).find('>parameter').each(function () {
660 660
                     lines += 'a=ssrc:' + ssrc + ' ' + $(this).attr('name');
661 661
                     if ($(this).attr('value') && $(this).attr('value').length)
662
-                        lines += ':' + $(this).attr('value');
662
+                        {lines += ':' + $(this).attr('value');}
663 663
                     lines += '\r\n';
664 664
                 });
665 665
             });
666 666
             currentRemoteSdp.media.forEach(function(media, idx) {
667 667
                 if (!SDPUtil.find_line(media, 'a=mid:' + name))
668
-                    return;
668
+                    {return;}
669 669
                 if (!addSsrcInfo[idx]) {
670 670
                     addSsrcInfo[idx] = '';
671 671
                 }
@@ -1023,7 +1023,7 @@ export default class JingleSessionPC extends JingleSession {
1023 1023
             });
1024 1024
             currentRemoteSdp.media.forEach(function(media, idx) {
1025 1025
                 if (!SDPUtil.find_line(media, 'a=mid:' + name))
1026
-                    return;
1026
+                    {return;}
1027 1027
                 if (!removeSsrcInfo[idx]) {
1028 1028
                     removeSsrcInfo[idx] = '';
1029 1029
                 }
@@ -1318,7 +1318,7 @@ export default class JingleSessionPC extends JingleSession {
1318 1318
                 error.code = errorElSel.attr('code');
1319 1319
                 const errorReasonSel = $(errResponse).find('error :first');
1320 1320
                 if (errorReasonSel.length)
1321
-                    error.reason = errorReasonSel[0].tagName;
1321
+                    {error.reason = errorReasonSel[0].tagName;}
1322 1322
             }
1323 1323
 
1324 1324
             if (!errResponse) {
@@ -1431,7 +1431,7 @@ export default class JingleSessionPC extends JingleSession {
1431 1431
                 const desc = $(jingle.tree()).find(">jingle>content[name=\"" +
1432 1432
                     ssrcObj.mtype + "\"]>description");
1433 1433
                 if (!desc || !desc.length)
1434
-                    return;
1434
+                    {return;}
1435 1435
                 ssrcObj.ssrcs.forEach(function (ssrc) {
1436 1436
                     const sourceNode = desc.find(">source[ssrc=\"" +
1437 1437
                         ssrc + "\"]");
@@ -1496,7 +1496,7 @@ export default class JingleSessionPC extends JingleSession {
1496 1496
         let ssrcs = this.modifiedSSRCs["mute"];
1497 1497
         this.modifiedSSRCs["mute"] = [];
1498 1498
         if (ssrcs && ssrcs.length)
1499
-            ssrcs.forEach(function (ssrcObj) {
1499
+            {ssrcs.forEach(function (ssrcObj) {
1500 1500
                 ssrcObj.ssrcs.forEach(function (ssrc) {
1501 1501
                     const sourceNode
1502 1502
                         = $(jingle.tree()).find(">jingle>content[name=\"" +
@@ -1513,12 +1513,12 @@ export default class JingleSessionPC extends JingleSession {
1513 1513
                             group.ssrcs[0] + "\"])");
1514 1514
                     groupNode.remove();
1515 1515
                 });
1516
-            });
1516
+            });}
1517 1517
 
1518 1518
         ssrcs = this.modifiedSSRCs["remove"];
1519 1519
         this.modifiedSSRCs["remove"] = [];
1520 1520
         if (ssrcs && ssrcs.length)
1521
-            ssrcs.forEach(function (ssrcObj) {
1521
+            {ssrcs.forEach(function (ssrcObj) {
1522 1522
                 const desc
1523 1523
                     = JingleSessionPC.createDescriptionNode(
1524 1524
                         jingle, ssrcObj.mtype);
@@ -1548,7 +1548,7 @@ export default class JingleSessionPC extends JingleSession {
1548 1548
                             "</ssrc-group>");
1549 1549
                     }
1550 1550
                 });
1551
-            });
1551
+            });}
1552 1552
     }
1553 1553
 
1554 1554
     /**

+ 8
- 8
modules/xmpp/SDP.js Voir le fichier

@@ -93,7 +93,7 @@ SDP.prototype.containsSSRC = function (ssrc) {
93 93
     var result = false;
94 94
     Object.keys(medias).forEach(function (mediaindex) {
95 95
         if (result)
96
-            return;
96
+            {return;}
97 97
         if (medias[mediaindex].ssrcs[ssrc]) {
98 98
             result = true;
99 99
         }
@@ -109,14 +109,14 @@ SDP.prototype.mangle = function () {
109 109
         lines.pop(); // remove empty last element
110 110
         mline = SDPUtil.parse_mline(lines.shift());
111 111
         if (mline.media != 'audio')
112
-            continue;
112
+            {continue;}
113 113
         newdesc = '';
114 114
         mline.fmt.length = 0;
115 115
         for (j = 0; j < lines.length; j++) {
116 116
             if (lines[j].substr(0, 9) == 'a=rtpmap:') {
117 117
                 rtpmap = SDPUtil.parse_rtpmap(lines[j]);
118 118
                 if (rtpmap.name == 'CN' || rtpmap.name == 'ISAC')
119
-                    continue;
119
+                    {continue;}
120 120
                 mline.fmt.push(rtpmap.id);
121 121
             }
122 122
             newdesc += lines[j] + '\r\n';
@@ -369,7 +369,7 @@ SDP.prototype.transportToJingle = function (mediaindex, elem) {
369 369
             });
370 370
         // Optional stream count attribute
371 371
         if (sctpAttrs.length > 2)
372
-            elem.attrs({ streams: sctpAttrs[2]});
372
+            {elem.attrs({ streams: sctpAttrs[2]});}
373 373
         elem.up();
374 374
     }
375 375
     // XEP-0320
@@ -521,14 +521,14 @@ SDP.prototype.jingle2media = function (content) {
521 521
 
522 522
         var streamCount = sctp.attr('streams');
523 523
         if (streamCount)
524
-            media += ' ' + streamCount + '\r\n';
524
+            {media += ' ' + streamCount + '\r\n';}
525 525
         else
526
-            media += '\r\n';
526
+            {media += '\r\n';}
527 527
     }
528 528
 
529 529
     media += 'c=IN IP4 0.0.0.0\r\n';
530 530
     if (!sctp.length)
531
-        media += 'a=rtcp:1 IN IP4 0.0.0.0\r\n';
531
+        {media += 'a=rtcp:1 IN IP4 0.0.0.0\r\n';}
532 532
     tmp = content.find('>transport[xmlns="urn:xmpp:jingle:transports:ice-udp:1"]');
533 533
     if (tmp.length) {
534 534
         if (tmp.attr('ufrag')) {
@@ -641,7 +641,7 @@ SDP.prototype.jingle2media = function (content) {
641 641
             value = SDPUtil.filter_special_chars(value);
642 642
             media += 'a=ssrc:' + ssrc + ' ' + name;
643 643
             if (value && value.length)
644
-                media += ':' + value;
644
+                {media += ':' + value;}
645 645
             media += '\r\n';
646 646
         });
647 647
     });

+ 3
- 3
modules/xmpp/SDPDiffer.js Voir le fichier

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

+ 2
- 2
modules/xmpp/SDPUtil.js Voir le fichier

@@ -246,7 +246,7 @@ var SDPUtil = {
246 246
             needles = [];
247 247
         for (var i = 0; i < lines.length; i++) {
248 248
             if (lines[i].substring(0, needle.length) == needle)
249
-                needles.push(lines[i]);
249
+                {needles.push(lines[i]);}
250 250
         }
251 251
         if (needles.length || !sessionpart) {
252 252
             return needles;
@@ -271,7 +271,7 @@ var SDPUtil = {
271 271
             return null;
272 272
         }
273 273
         if (line.substring(line.length - 2) == '\r\n') // chomp it
274
-            line = line.substring(0, line.length - 2);
274
+            {line = line.substring(0, line.length - 2);}
275 275
         var candidate = {},
276 276
             elems = line.split(' '),
277 277
             i;

+ 8
- 8
modules/xmpp/recording.js Voir le fichier

@@ -56,13 +56,13 @@ Recording.action = {
56 56
 Recording.prototype.handleJibriPresence = function (jibri) {
57 57
     var attributes = jibri.attributes;
58 58
     if(!attributes)
59
-        return;
59
+        {return;}
60 60
 
61 61
     var newState = attributes.status;
62 62
     logger.log("Handle jibri presence : ", newState);
63 63
 
64 64
     if (newState === this.state)
65
-        return;
65
+        {return;}
66 66
 
67 67
     if (newState === "undefined") {
68 68
         this.state = Recording.status.UNAVAILABLE;
@@ -71,9 +71,9 @@ Recording.prototype.handleJibriPresence = function (jibri) {
71 71
         if (!this.state
72 72
             || this.state === "undefined"
73 73
             || this.state === Recording.status.UNAVAILABLE)
74
-            this.state = Recording.status.AVAILABLE;
74
+            {this.state = Recording.status.AVAILABLE;}
75 75
         else
76
-            this.state = Recording.status.OFF;
76
+            {this.state = Recording.status.OFF;}
77 77
     }
78 78
     else {
79 79
         this.state = newState;
@@ -225,11 +225,11 @@ Recording.prototype.toggleRecording = function (options, statusChangeHandler) {
225 225
     // If the recorder is currently unavailable we throw an error.
226 226
     if (oldState === Recording.status.UNAVAILABLE
227 227
         || oldState === Recording.status.FAILED)
228
-        statusChangeHandler(Recording.status.FAILED,
229
-                            JitsiRecorderErrors.RECORDER_UNAVAILABLE);
228
+        {statusChangeHandler(Recording.status.FAILED,
229
+                            JitsiRecorderErrors.RECORDER_UNAVAILABLE);}
230 230
     else if (oldState === Recording.status.BUSY)
231
-        statusChangeHandler(Recording.status.BUSY,
232
-                            JitsiRecorderErrors.RECORDER_BUSY);
231
+        {statusChangeHandler(Recording.status.BUSY,
232
+                            JitsiRecorderErrors.RECORDER_BUSY);}
233 233
 
234 234
     // If we're about to turn ON the recording we need either a streamId or
235 235
     // an authentication token depending on the recording type. If we don't

+ 5
- 5
modules/xmpp/strophe.emuc.js Voir le fichier

@@ -62,7 +62,7 @@ class MucConnectionPlugin extends ConnectionPluginListenable {
62 62
 
63 63
         const room = this.rooms[Strophe.getBareJidFromJid(from)];
64 64
         if(!room)
65
-            return;
65
+            {return;}
66 66
 
67 67
         // Parse status.
68 68
         if ($(pres).find('>x[xmlns="http://jabber.org/protocol/muc#user"]' +
@@ -79,7 +79,7 @@ class MucConnectionPlugin extends ConnectionPluginListenable {
79 79
         const from = pres.getAttribute('from');
80 80
         const room = this.rooms[Strophe.getBareJidFromJid(from)];
81 81
         if(!room)
82
-            return;
82
+            {return;}
83 83
 
84 84
         room.onPresenceUnavailable(pres, from);
85 85
         return true;
@@ -89,7 +89,7 @@ class MucConnectionPlugin extends ConnectionPluginListenable {
89 89
         const from = pres.getAttribute('from');
90 90
         const room = this.rooms[Strophe.getBareJidFromJid(from)];
91 91
         if(!room)
92
-            return;
92
+            {return;}
93 93
 
94 94
         room.onPresenceError(pres, from);
95 95
         return true;
@@ -100,7 +100,7 @@ class MucConnectionPlugin extends ConnectionPluginListenable {
100 100
         const from = msg.getAttribute('from');
101 101
         const room = this.rooms[Strophe.getBareJidFromJid(from)];
102 102
         if(!room)
103
-            return;
103
+            {return;}
104 104
 
105 105
         room.onMessage(msg, from);
106 106
         return true;
@@ -110,7 +110,7 @@ class MucConnectionPlugin extends ConnectionPluginListenable {
110 110
         const from = iq.getAttribute('from');
111 111
         const room = this.rooms[Strophe.getBareJidFromJid(from)];
112 112
         if(!room)
113
-            return;
113
+            {return;}
114 114
 
115 115
         room.onMute(iq);
116 116
         return true;

+ 3
- 3
modules/xmpp/xmpp.js Voir le fichier

@@ -120,13 +120,13 @@ export default class XMPP extends Listenable {
120 120
                 pingJid,
121 121
                 function (hasPing) {
122 122
                     if (hasPing)
123
-                        this.connection.ping.startInterval(pingJid);
123
+                        {this.connection.ping.startInterval(pingJid);}
124 124
                     else
125
-                        logger.warn("Ping NOT supported by " + pingJid);
125
+                        {logger.warn("Ping NOT supported by " + pingJid);}
126 126
                 }.bind(this));
127 127
 
128 128
             if (password)
129
-                this.authenticatedUser = true;
129
+                {this.authenticatedUser = true;}
130 130
             if (this.connection && this.connection.connected &&
131 131
                 Strophe.getResourceFromJid(this.connection.jid)) {
132 132
                 // .connected is true while connecting?

Chargement…
Annuler
Enregistrer