Browse Source

fix(eslint): Add curly rule

master
hristoterezov 8 years ago
parent
commit
c36b464bfc

+ 1
- 0
.eslintrc.js View File

75
         'block-scoped-var': 0,
75
         'block-scoped-var': 0,
76
         'complexity': 0,
76
         'complexity': 0,
77
         'consistent-return': 0,
77
         'consistent-return': 0,
78
+        'curly': 2,
78
 
79
 
79
         'prefer-const': 2,
80
         'prefer-const': 2,
80
         'prefer-reflect': 0,
81
         'prefer-reflect': 0,

+ 22
- 22
JitsiConference.js View File

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

+ 4
- 4
JitsiConferenceEventManager.js View File

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

+ 3
- 3
JitsiConnection.js View File

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

+ 4
- 4
JitsiMeetJS.js View File

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

+ 7
- 7
doc/example/example.js View File

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

+ 3
- 3
modules/RTC/DataChannels.js View File

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

+ 12
- 12
modules/RTC/JitsiLocalTrack.js View File

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

+ 9
- 9
modules/RTC/JitsiRemoteTrack.js View File

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

+ 10
- 10
modules/RTC/JitsiTrack.js View File

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

+ 5
- 5
modules/RTC/RTC.js View File

165
         // cache the value if channel is missing, till we open it
165
         // cache the value if channel is missing, till we open it
166
         this.selectedEndpoint = id;
166
         this.selectedEndpoint = id;
167
         if(this.dataChannels && this.dataChannelsOpen)
167
         if(this.dataChannels && this.dataChannelsOpen)
168
-            this.dataChannels.sendSelectedEndpointMessage(id);
168
+            {this.dataChannels.sendSelectedEndpointMessage(id);}
169
     }
169
     }
170
 
170
 
171
     /**
171
     /**
253
 
253
 
254
     addLocalTrack (track) {
254
     addLocalTrack (track) {
255
         if (!track)
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
         this.localTracks.push(track);
258
         this.localTracks.push(track);
259
 
259
 
331
      */
331
      */
332
     getRemoteTrackByType (type, resource) {
332
     getRemoteTrackByType (type, resource) {
333
         if (this.remoteTracks[resource])
333
         if (this.remoteTracks[resource])
334
-            return this.remoteTracks[resource][type];
334
+            {return this.remoteTracks[resource][type];}
335
         else
335
         else
336
-            return null;
336
+            {return null;}
337
     }
337
     }
338
 
338
 
339
     /**
339
     /**
633
 
633
 
634
     setAudioLevel (resource, audioLevel) {
634
     setAudioLevel (resource, audioLevel) {
635
         if(!resource)
635
         if(!resource)
636
-            return;
636
+            {return;}
637
         var audioTrack = this.getRemoteAudioTrack(resource);
637
         var audioTrack = this.getRemoteAudioTrack(resource);
638
         if(audioTrack) {
638
         if(audioTrack) {
639
             audioTrack.setAudioLevel(audioLevel);
639
             audioTrack.setAudioLevel(audioLevel);

+ 1
- 1
modules/RTC/RTCBrowserType.js View File

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

+ 6
- 6
modules/RTC/RTCUtils.js View File

117
     }
117
     }
118
 
118
 
119
     if (constraints.video.mandatory.minWidth)
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
     if (constraints.video.mandatory.minHeight)
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
                     if (element) {
772
                     if (element) {
773
                         defaultSetVideoSrc(element, stream);
773
                         defaultSetVideoSrc(element, stream);
774
                         if (stream)
774
                         if (stream)
775
-                            element.play();
775
+                            {element.play();}
776
                     }
776
                     }
777
                     return element;
777
                     return element;
778
                 });
778
                 });
1146
 
1146
 
1147
     _isDeviceListAvailable () {
1147
     _isDeviceListAvailable () {
1148
         if (!rtcReady)
1148
         if (!rtcReady)
1149
-            throw new Error("WebRTC not ready yet");
1149
+            {throw new Error("WebRTC not ready yet");}
1150
         var isEnumerateDevicesAvailable
1150
         var isEnumerateDevicesAvailable
1151
             = navigator.mediaDevices && navigator.mediaDevices.enumerateDevices;
1151
             = navigator.mediaDevices && navigator.mediaDevices.enumerateDevices;
1152
         if (isEnumerateDevicesAvailable) {
1152
         if (isEnumerateDevicesAvailable) {

+ 5
- 5
modules/RTC/ScreenObtainer.js View File

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

+ 2
- 2
modules/RTC/TraceablePeerConnection.js View File

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

+ 3
- 3
modules/TalkMutedDetection.js View File

60
         // We are interested in the local audio stream only and if event is not
60
         // We are interested in the local audio stream only and if event is not
61
         // sent yet.
61
         // sent yet.
62
         if (!isLocal || !this.audioTrack || this._eventFired)
62
         if (!isLocal || !this.audioTrack || this._eventFired)
63
-            return;
63
+            {return;}
64
 
64
 
65
         if (this.audioTrack.isMuted() && audioLevel > 0.6) {
65
         if (this.audioTrack.isMuted() && audioLevel > 0.6) {
66
             this._eventFired = true;
66
             this._eventFired = true;
92
      */
92
      */
93
     _trackAdded(track) {
93
     _trackAdded(track) {
94
         if (this._isLocalAudioTrack(track))
94
         if (this._isLocalAudioTrack(track))
95
-            this.audioTrack = track;
95
+            {this.audioTrack = track;}
96
     }
96
     }
97
 
97
 
98
     /**
98
     /**
105
      */
105
      */
106
     _trackMuteChanged(track) {
106
     _trackMuteChanged(track) {
107
         if (this._isLocalAudioTrack(track) && track.isMuted())
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 View File

213
 CallStats._checkInitialize = function () {
213
 CallStats._checkInitialize = function () {
214
     if (CallStats.initialized || !CallStats.initializeFailed
214
     if (CallStats.initialized || !CallStats.initializeFailed
215
         || !callStats || CallStats.initializeInProgress)
215
         || !callStats || CallStats.initializeInProgress)
216
-        return;
216
+        {return;}
217
 
217
 
218
     // callstats object created, not initialized and it had previously failed,
218
     // callstats object created, not initialized and it had previously failed,
219
     // and there is no init in progress, so lets try initialize it again
219
     // and there is no init in progress, so lets try initialize it again
237
 
237
 
238
 CallStats.prototype.pcCallback = _try_catch(function (err, msg) {
238
 CallStats.prototype.pcCallback = _try_catch(function (err, msg) {
239
     if (callStats && err !== 'success')
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 View File

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

+ 9
- 9
modules/statistics/RTPStatsCollector.js View File

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

+ 19
- 19
modules/statistics/statistics.js View File

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

+ 1
- 1
modules/util/EventEmitterForwarder.js View File

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

+ 4
- 4
modules/util/GlobalOnErrorHandler.js View File

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

+ 3
- 3
modules/util/ScriptUtil.js View File

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

+ 1
- 1
modules/version/ComponentsVersions.js View File

75
 
75
 
76
     // logs versions to stats
76
     // logs versions to stats
77
     if (log.length > 0)
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 View File

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

+ 17
- 17
modules/xmpp/JingleSessionPC.js View File

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

+ 8
- 8
modules/xmpp/SDP.js View File

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

+ 3
- 3
modules/xmpp/SDPDiffer.js View File

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

+ 2
- 2
modules/xmpp/SDPUtil.js View File

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

+ 8
- 8
modules/xmpp/recording.js View File

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

+ 5
- 5
modules/xmpp/strophe.emuc.js View File

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

+ 3
- 3
modules/xmpp/xmpp.js View File

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

Loading…
Cancel
Save