浏览代码

[eslint] object-property-newline

master
Lyubo Marinov 8 年前
父节点
当前提交
9a8b5563c6

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

201
         'no-whitespace-before-property': 2,
201
         'no-whitespace-before-property': 2,
202
         'object-curly-newline': 0,
202
         'object-curly-newline': 0,
203
         'object-curly-spacing': [ 'error', 'always' ],
203
         'object-curly-spacing': [ 'error', 'always' ],
204
+        'object-property-newline': 2,
204
         'one-var': 0,
205
         'one-var': 0,
205
         'one-var-declaration-per-line': 0,
206
         'one-var-declaration-per-line': 0,
206
         'operator-assignment': 0,
207
         'operator-assignment': 0,

+ 8
- 2
JitsiConference.js 查看文件

61
     this.authEnabled = false;
61
     this.authEnabled = false;
62
     this.startAudioMuted = false;
62
     this.startAudioMuted = false;
63
     this.startVideoMuted = false;
63
     this.startVideoMuted = false;
64
-    this.startMutedPolicy = { audio: false, video: false };
64
+    this.startMutedPolicy = {
65
+        audio: false,
66
+        video: false
67
+    };
65
     this.availableDevices = {
68
     this.availableDevices = {
66
         audio: undefined,
69
         audio: undefined,
67
         video: undefined
70
         video: undefined
399
         // remove previously set nickname
402
         // remove previously set nickname
400
         this.room.removeFromPresence('nick');
403
         this.room.removeFromPresence('nick');
401
 
404
 
402
-        this.room.addToPresence('nick', { attributes: { xmlns: 'http://jabber.org/protocol/nick' }, value: name });
405
+        this.room.addToPresence('nick', {
406
+            attributes: { xmlns: 'http://jabber.org/protocol/nick' },
407
+            value: name
408
+        });
403
         this.room.sendPresence();
409
         this.room.sendPresence();
404
     }
410
     }
405
 };
411
 };

+ 4
- 2
JitsiConferenceEventManager.js 查看文件

279
     conference.room.addListener(XMPPEvents.LOCAL_UFRAG_CHANGED,
279
     conference.room.addListener(XMPPEvents.LOCAL_UFRAG_CHANGED,
280
         ufrag => {
280
         ufrag => {
281
             Statistics.sendLog(
281
             Statistics.sendLog(
282
-                JSON.stringify({ id: 'local_ufrag', value: ufrag }));
282
+                JSON.stringify({ id: 'local_ufrag',
283
+                    value: ufrag }));
283
         });
284
         });
284
     conference.room.addListener(XMPPEvents.REMOTE_UFRAG_CHANGED,
285
     conference.room.addListener(XMPPEvents.REMOTE_UFRAG_CHANGED,
285
         ufrag => {
286
         ufrag => {
286
             Statistics.sendLog(
287
             Statistics.sendLog(
287
-                JSON.stringify({ id: 'remote_ufrag', value: ufrag }));
288
+                JSON.stringify({ id: 'remote_ufrag',
289
+                    value: ufrag }));
288
         });
290
         });
289
 
291
 
290
     chatRoom.addPresenceListener('startmuted', (data, from) => {
292
     chatRoom.addPresenceListener('startmuted', (data, from) => {

+ 5
- 2
JitsiConnection.js 查看文件

35
                     `connection.disconnected.${msg}`);
35
                     `connection.disconnected.${msg}`);
36
             }
36
             }
37
             Statistics.sendLog(
37
             Statistics.sendLog(
38
-                JSON.stringify({ id: 'connection.disconnected', msg }));
38
+                JSON.stringify({ id: 'connection.disconnected',
39
+                    msg }));
39
         });
40
         });
40
 }
41
 }
41
 
42
 
91
  * @returns {JitsiConference} returns the new conference object.
92
  * @returns {JitsiConference} returns the new conference object.
92
  */
93
  */
93
 JitsiConnection.prototype.initJitsiConference = function(name, options) {
94
 JitsiConnection.prototype.initJitsiConference = function(name, options) {
94
-    return new JitsiConference({ name, config: options, connection: this });
95
+    return new JitsiConference({ name,
96
+        config: options,
97
+        connection: this });
95
 };
98
 };
96
 
99
 
97
 /**
100
 /**

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

139
  * @param {bool} firefox_fake_device
139
  * @param {bool} firefox_fake_device
140
  */
140
  */
141
 function getConstraints(um, options) {
141
 function getConstraints(um, options) {
142
-    const constraints = { audio: false, video: false };
142
+    const constraints = { audio: false,
143
+        video: false };
143
 
144
 
144
     // Don't mix new and old style settings for Chromium as this leads
145
     // Don't mix new and old style settings for Chromium as this leads
145
     // to TypeError in new Chromium versions. @see
146
     // to TypeError in new Chromium versions. @see
155
 
156
 
156
     if (um.indexOf('video') >= 0) {
157
     if (um.indexOf('video') >= 0) {
157
         // same behaviour as true
158
         // same behaviour as true
158
-        constraints.video = { mandatory: {}, optional: [] };
159
+        constraints.video = { mandatory: {},
160
+            optional: [] };
159
 
161
 
160
         if (options.cameraDeviceId) {
162
         if (options.cameraDeviceId) {
161
             if (isNewStyleConstraintsSupported) {
163
             if (isNewStyleConstraintsSupported) {
214
             }
216
             }
215
         } else {
217
         } else {
216
             // same behaviour as true
218
             // same behaviour as true
217
-            constraints.audio = { mandatory: {}, optional: [] };
219
+            constraints.audio = { mandatory: {},
220
+                optional: [] };
218
             if (options.micDeviceId) {
221
             if (options.micDeviceId) {
219
                 if (isNewStyleConstraintsSupported) {
222
                 if (isNewStyleConstraintsSupported) {
220
                     // New style of setting device id.
223
                     // New style of setting device id.
287
     if (options.bandwidth) {
290
     if (options.bandwidth) {
288
         if (!constraints.video) {
291
         if (!constraints.video) {
289
             // same behaviour as true
292
             // same behaviour as true
290
-            constraints.video = { mandatory: {}, optional: [] };
293
+            constraints.video = { mandatory: {},
294
+                optional: [] };
291
         }
295
         }
292
         constraints.video.optional.push({ bandwidth: options.bandwidth });
296
         constraints.video.optional.push({ bandwidth: options.bandwidth });
293
     }
297
     }
671
                     const err = new JitsiTrackError(ex, null, [ 'audiooutput' ]);
675
                     const err = new JitsiTrackError(ex, null, [ 'audiooutput' ]);
672
 
676
 
673
                     GlobalOnErrorHandler.callUnhandledRejectionHandler(
677
                     GlobalOnErrorHandler.callUnhandledRejectionHandler(
674
-                        { promise: this, reason: err });
678
+                        { promise: this,
679
+                            reason: err });
675
 
680
 
676
                     logger.warn('Failed to set audio output device for the '
681
                     logger.warn('Failed to set audio output device for the '
677
                         + 'element. Default audio output device will be used '
682
                         + 'element. Default audio output device will be used '

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

975
  * - groups - Array of the groups associated with the stream.
975
  * - groups - Array of the groups associated with the stream.
976
  */
976
  */
977
 TraceablePeerConnection.prototype.generateNewStreamSSRCInfo = function() {
977
 TraceablePeerConnection.prototype.generateNewStreamSSRCInfo = function() {
978
-    let ssrcInfo = { ssrcs: [], groups: [] };
978
+    let ssrcInfo = { ssrcs: [],
979
+        groups: [] };
979
 
980
 
980
     if (!this.options.disableSimulcast
981
     if (!this.options.disableSimulcast
981
         && this.simulcast.isSupported()) {
982
         && this.simulcast.isSupported()) {

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

20
  * See media/engine/simulcast.ss from webrtc.org
20
  * See media/engine/simulcast.ss from webrtc.org
21
  */
21
  */
22
 const kSimulcastFormats = [
22
 const kSimulcastFormats = [
23
-    { width: 1920, height: 1080, layers: 3, max: 5000, target: 4000, min: 800 },
24
-    { width: 1280, height: 720, layers: 3, max: 2500, target: 2500, min: 600 },
25
-    { width: 960, height: 540, layers: 3, max: 900, target: 900, min: 450 },
26
-    { width: 640, height: 360, layers: 2, max: 700, target: 500, min: 150 },
27
-    { width: 480, height: 270, layers: 2, max: 450, target: 350, min: 150 },
28
-    { width: 320, height: 180, layers: 1, max: 200, target: 150, min: 30 }
23
+    { width: 1920,
24
+        height: 1080,
25
+        layers: 3,
26
+        max: 5000,
27
+        target: 4000,
28
+        min: 800 },
29
+    { width: 1280,
30
+        height: 720,
31
+        layers: 3,
32
+        max: 2500,
33
+        target: 2500,
34
+        min: 600 },
35
+    { width: 960,
36
+        height: 540,
37
+        layers: 3,
38
+        max: 900,
39
+        target: 900,
40
+        min: 450 },
41
+    { width: 640,
42
+        height: 360,
43
+        layers: 2,
44
+        max: 700,
45
+        target: 500,
46
+        min: 150 },
47
+    { width: 480,
48
+        height: 270,
49
+        layers: 2,
50
+        max: 450,
51
+        target: 350,
52
+        min: 150 },
53
+    { width: 320,
54
+        height: 180,
55
+        layers: 1,
56
+        max: 200,
57
+        target: 150,
58
+        min: 30 }
29
 ];
59
 ];
30
 
60
 
31
 /**
61
 /**

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

363
     } else {
363
     } else {
364
         CallStats.reportsQueue.push({
364
         CallStats.reportsQueue.push({
365
             type: reportType.EVENT,
365
             type: reportType.EVENT,
366
-            data: { event, eventData }
366
+            data: { event,
367
+                eventData }
367
         });
368
         });
368
         CallStats._checkInitialize();
369
         CallStats._checkInitialize();
369
     }
370
     }
428
     } else {
429
     } else {
429
         CallStats.reportsQueue.push({
430
         CallStats.reportsQueue.push({
430
             type: reportType.ERROR,
431
             type: reportType.ERROR,
431
-            data: { type, error: e, pc }
432
+            data: { type,
433
+                error: e,
434
+                pc }
432
         });
435
         });
433
         CallStats._checkInitialize();
436
         CallStats._checkInitialize();
434
     }
437
     }

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

444
             if (!conferenceStatsTransport.some(
444
             if (!conferenceStatsTransport.some(
445
                     t =>
445
                     t =>
446
                         t.ip == ip && t.type == type && t.localip == localip)) {
446
                         t.ip == ip && t.type == type && t.localip == localip)) {
447
-                conferenceStatsTransport.push({ ip, type, localip });
447
+                conferenceStatsTransport.push({ ip,
448
+                    type,
449
+                    localip });
448
             }
450
             }
449
             continue;
451
             continue;
450
         }
452
         }
546
             'upload': bitrateSentKbps
548
             'upload': bitrateSentKbps
547
         });
549
         });
548
 
550
 
549
-        const resolution = { height: null, width: null };
551
+        const resolution = { height: null,
552
+            width: null };
550
 
553
 
551
         try {
554
         try {
552
             let height, width;
555
             let height, width;
607
     this.eventEmitter.emit(StatisticsEvents.BYTE_SENT_STATS, byteSentStats);
610
     this.eventEmitter.emit(StatisticsEvents.BYTE_SENT_STATS, byteSentStats);
608
 
611
 
609
     this.conferenceStats.bitrate
612
     this.conferenceStats.bitrate
610
-      = { 'upload': bitrateUpload, 'download': bitrateDownload };
613
+      = { 'upload': bitrateUpload,
614
+          'download': bitrateDownload };
611
 
615
 
612
     this.conferenceStats.packetLoss = {
616
     this.conferenceStats.packetLoss = {
613
         total:
617
         total:

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

443
         this.callstats.sendFeedback(overall, detailed);
443
         this.callstats.sendFeedback(overall, detailed);
444
     }
444
     }
445
     Statistics.analytics.sendEvent('feedback.rating',
445
     Statistics.analytics.sendEvent('feedback.rating',
446
-        { value: overall, detailed });
446
+        { value: overall,
447
+            detailed });
447
 };
448
 };
448
 
449
 
449
 Statistics.LOCAL_JID = require('../../service/statistics/constants').LOCAL_JID;
450
 Statistics.LOCAL_JID = require('../../service/statistics/constants').LOCAL_JID;
468
  */
469
  */
469
 Statistics.sendEventToAll = function(eventName, data) {
470
 Statistics.sendEventToAll = function(eventName, data) {
470
     this.analytics.sendEvent(eventName, data);
471
     this.analytics.sendEvent(eventName, data);
471
-    Statistics.sendLog(JSON.stringify({ name: eventName, data }));
472
+    Statistics.sendLog(JSON.stringify({ name: eventName,
473
+        data }));
472
 };
474
 };
473
 
475
 
474
 module.exports = Statistics;
476
 module.exports = Statistics;

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

212
         const node = caps.getAttribute('node');
212
         const node = caps.getAttribute('node');
213
         const oldVersion = this.jidToVersion[from];
213
         const oldVersion = this.jidToVersion[from];
214
 
214
 
215
-        this.jidToVersion[from] = { version, node };
215
+        this.jidToVersion[from] = { version,
216
+            node };
216
         if (oldVersion && oldVersion.version !== version) {
217
         if (oldVersion && oldVersion.version !== version) {
217
             this.eventEmitter.emit(XMPPEvents.PARTCIPANT_FEATURES_CHANGED,
218
             this.eventEmitter.emit(XMPPEvents.PARTCIPANT_FEATURES_CHANGED,
218
                 from);
219
                 from);

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

93
         this.noBridgeAvailable = false;
93
         this.noBridgeAvailable = false;
94
         this.options = options || {};
94
         this.options = options || {};
95
         this.moderator = new Moderator(this.roomjid, this.xmpp, this.eventEmitter,
95
         this.moderator = new Moderator(this.roomjid, this.xmpp, this.eventEmitter,
96
-            { connection: this.xmpp.options, conference: this.options });
96
+            { connection: this.xmpp.options,
97
+                conference: this.options });
97
         this.initPresenceMap();
98
         this.initPresenceMap();
98
         this.lastPresences = {};
99
         this.lastPresences = {};
99
         this.phoneNumber = null;
100
         this.phoneNumber = null;
180
      */
181
      */
181
     doLeave() {
182
     doLeave() {
182
         logger.log('do leave', this.myroomjid);
183
         logger.log('do leave', this.myroomjid);
183
-        const pres = $pres({ to: this.myroomjid, type: 'unavailable' });
184
+        const pres = $pres({ to: this.myroomjid,
185
+            type: 'unavailable' });
184
 
186
 
185
         this.presMap.length = 0;
187
         this.presMap.length = 0;
186
 
188
 
203
     discoRoomInfo() {
205
     discoRoomInfo() {
204
       // https://xmpp.org/extensions/xep-0045.html#disco-roominfo
206
       // https://xmpp.org/extensions/xep-0045.html#disco-roominfo
205
 
207
 
206
-        const getInfo = $iq({ type: 'get', to: this.roomjid })
208
+        const getInfo = $iq({ type: 'get',
209
+            to: this.roomjid })
207
         .c('query', { xmlns: Strophe.NS.DISCO_INFO });
210
         .c('query', { xmlns: Strophe.NS.DISCO_INFO });
208
 
211
 
209
         this.connection.sendIQ(getInfo, result => {
212
         this.connection.sendIQ(getInfo, result => {
226
     createNonAnonymousRoom() {
229
     createNonAnonymousRoom() {
227
         // http://xmpp.org/extensions/xep-0045.html#createroom-reserved
230
         // http://xmpp.org/extensions/xep-0045.html#createroom-reserved
228
 
231
 
229
-        const getForm = $iq({ type: 'get', to: this.roomjid })
232
+        const getForm = $iq({ type: 'get',
233
+            to: this.roomjid })
230
             .c('query', { xmlns: 'http://jabber.org/protocol/muc#owner' })
234
             .c('query', { xmlns: 'http://jabber.org/protocol/muc#owner' })
231
-            .c('x', { xmlns: 'jabber:x:data', type: 'submit' });
235
+            .c('x', { xmlns: 'jabber:x:data',
236
+                type: 'submit' });
232
 
237
 
233
         const self = this;
238
         const self = this;
234
 
239
 
244
                 return;
249
                 return;
245
             }
250
             }
246
 
251
 
247
-            const formSubmit = $iq({ to: self.roomjid, type: 'set' })
252
+            const formSubmit = $iq({ to: self.roomjid,
253
+                type: 'set' })
248
                 .c('query', { xmlns: 'http://jabber.org/protocol/muc#owner' });
254
                 .c('query', { xmlns: 'http://jabber.org/protocol/muc#owner' });
249
 
255
 
250
-            formSubmit.c('x', { xmlns: 'jabber:x:data', type: 'submit' });
256
+            formSubmit.c('x', { xmlns: 'jabber:x:data',
257
+                type: 'submit' });
251
 
258
 
252
             formSubmit.c('field', { 'var': 'FORM_TYPE' })
259
             formSubmit.c('field', { 'var': 'FORM_TYPE' })
253
                 .c('value')
260
                 .c('value')
477
     }
484
     }
478
 
485
 
479
     sendMessage(body, nickname) {
486
     sendMessage(body, nickname) {
480
-        const msg = $msg({ to: this.roomjid, type: 'groupchat' });
487
+        const msg = $msg({ to: this.roomjid,
488
+            type: 'groupchat' });
481
 
489
 
482
         msg.c('body', body).up();
490
         msg.c('body', body).up();
483
         if (nickname) {
491
         if (nickname) {
488
     }
496
     }
489
 
497
 
490
     setSubject(subject) {
498
     setSubject(subject) {
491
-        const msg = $msg({ to: this.roomjid, type: 'groupchat' });
499
+        const msg = $msg({ to: this.roomjid,
500
+            type: 'groupchat' });
492
 
501
 
493
         msg.c('subject', subject);
502
         msg.c('subject', subject);
494
         this.connection.send(msg);
503
         this.connection.send(msg);
654
     }
663
     }
655
 
664
 
656
     kick(jid) {
665
     kick(jid) {
657
-        const kickIQ = $iq({ to: this.roomjid, type: 'set' })
666
+        const kickIQ = $iq({ to: this.roomjid,
667
+            type: 'set' })
658
             .c('query', { xmlns: 'http://jabber.org/protocol/muc#admin' })
668
             .c('query', { xmlns: 'http://jabber.org/protocol/muc#admin' })
659
-            .c('item', { nick: Strophe.getResourceFromJid(jid), role: 'none' })
669
+            .c('item', { nick: Strophe.getResourceFromJid(jid),
670
+                role: 'none' })
660
             .c('reason').t('You have been kicked.').up().up().up();
671
             .c('reason').t('You have been kicked.').up().up().up();
661
 
672
 
662
         this.connection.sendIQ(
673
         this.connection.sendIQ(
668
     lockRoom(key, onSuccess, onError, onNotSupported) {
679
     lockRoom(key, onSuccess, onError, onNotSupported) {
669
         // http://xmpp.org/extensions/xep-0045.html#roomconfig
680
         // http://xmpp.org/extensions/xep-0045.html#roomconfig
670
         this.connection.sendIQ(
681
         this.connection.sendIQ(
671
-            $iq({ to: this.roomjid, type: 'get' }).c('query', { xmlns: 'http://jabber.org/protocol/muc#owner' }),
682
+            $iq({ to: this.roomjid,
683
+                type: 'get' }).c('query', { xmlns: 'http://jabber.org/protocol/muc#owner' }),
672
             res => {
684
             res => {
673
                 if ($(res).find('>query>x[xmlns="jabber:x:data"]>field[var="muc#roomconfig_roomsecret"]').length) {
685
                 if ($(res).find('>query>x[xmlns="jabber:x:data"]>field[var="muc#roomconfig_roomsecret"]').length) {
674
                     const formsubmit
686
                     const formsubmit
675
-                        = $iq({ to: this.roomjid, type: 'set' })
687
+                        = $iq({ to: this.roomjid,
688
+                            type: 'set' })
676
                             .c('query', { xmlns: 'http://jabber.org/protocol/muc#owner' });
689
                             .c('query', { xmlns: 'http://jabber.org/protocol/muc#owner' });
677
 
690
 
678
-                    formsubmit.c('x', { xmlns: 'jabber:x:data', type: 'submit' });
691
+                    formsubmit.c('x', { xmlns: 'jabber:x:data',
692
+                        type: 'submit' });
679
                     formsubmit.c('field', { 'var': 'FORM_TYPE' }).c('value').t('http://jabber.org/protocol/muc#roomconfig').up().up();
693
                     formsubmit.c('field', { 'var': 'FORM_TYPE' }).c('value').t('http://jabber.org/protocol/muc#roomconfig').up().up();
680
                     formsubmit.c('field', { 'var': 'muc#roomconfig_roomsecret' }).c('value').t(key).up().up();
694
                     formsubmit.c('field', { 'var': 'muc#roomconfig_roomsecret' }).c('value').t(key).up().up();
681
                     // Fixes a bug in prosody 0.9.+ https://code.google.com/p/lxmppd/issues/detail?id=373
695
                     // Fixes a bug in prosody 0.9.+ https://code.google.com/p/lxmppd/issues/detail?id=373
919
     muteParticipant(jid, mute) {
933
     muteParticipant(jid, mute) {
920
         logger.info('set mute', mute);
934
         logger.info('set mute', mute);
921
         const iqToFocus = $iq(
935
         const iqToFocus = $iq(
922
-            { to: this.focusMucJid, type: 'set' })
936
+            { to: this.focusMucJid,
937
+                type: 'set' })
923
             .c('mute', {
938
             .c('mute', {
924
                 xmlns: 'http://jitsi.org/jitmeet/audio',
939
                 xmlns: 'http://jitsi.org/jitmeet/audio',
925
                 jid
940
                 jid

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

267
 
267
 
268
     sendIceCandidates(candidates) {
268
     sendIceCandidates(candidates) {
269
         logger.log('sendIceCandidates', candidates);
269
         logger.log('sendIceCandidates', candidates);
270
-        const cand = $iq({ to: this.peerjid, type: 'set' })
270
+        const cand = $iq({ to: this.peerjid,
271
+            type: 'set' })
271
             .c('jingle', { xmlns: 'urn:xmpp:jingle:1',
272
             .c('jingle', { xmlns: 'urn:xmpp:jingle:1',
272
                 action: 'transport-info',
273
                 action: 'transport-info',
273
                 initiator: this.initiator,
274
                 initiator: this.initiator,
542
      *        or when the request has timed out.
543
      *        or when the request has timed out.
543
      */
544
      */
544
     sendTransportAccept(localSDP, success, failure) {
545
     sendTransportAccept(localSDP, success, failure) {
545
-        let transportAccept = $iq({ to: this.peerjid, type: 'set' })
546
+        let transportAccept = $iq({ to: this.peerjid,
547
+            type: 'set' })
546
             .c('jingle', {
548
             .c('jingle', {
547
                 xmlns: 'urn:xmpp:jingle:1',
549
                 xmlns: 'urn:xmpp:jingle:1',
548
                 action: 'transport-accept',
550
                 action: 'transport-accept',
587
     sendTransportReject(success, failure) {
589
     sendTransportReject(success, failure) {
588
         // Send 'transport-reject', so that the focus will
590
         // Send 'transport-reject', so that the focus will
589
         // know that we've failed
591
         // know that we've failed
590
-        let transportReject = $iq({ to: this.peerjid, type: 'set' })
592
+        let transportReject = $iq({ to: this.peerjid,
593
+            type: 'set' })
591
             .c('jingle', {
594
             .c('jingle', {
592
                 xmlns: 'urn:xmpp:jingle:1',
595
                 xmlns: 'urn:xmpp:jingle:1',
593
                 action: 'transport-reject',
596
                 action: 'transport-reject',
610
     terminate(reason, text, success, failure) {
613
     terminate(reason, text, success, failure) {
611
         this.state = JingleSessionState.ENDED;
614
         this.state = JingleSessionState.ENDED;
612
 
615
 
613
-        let sessionTerminate = $iq({ to: this.peerjid, type: 'set' })
616
+        let sessionTerminate = $iq({ to: this.peerjid,
617
+            type: 'set' })
614
             .c('jingle', {
618
             .c('jingle', {
615
                 xmlns: 'urn:xmpp:jingle:1',
619
                 xmlns: 'urn:xmpp:jingle:1',
616
                 action: 'session-terminate',
620
                 action: 'session-terminate',
1322
 
1326
 
1323
         // send source-remove IQ.
1327
         // send source-remove IQ.
1324
         let sdpDiffer = new SDPDiffer(new_sdp, old_sdp);
1328
         let sdpDiffer = new SDPDiffer(new_sdp, old_sdp);
1325
-        const remove = $iq({ to: this.peerjid, type: 'set' })
1329
+        const remove = $iq({ to: this.peerjid,
1330
+            type: 'set' })
1326
             .c('jingle', {
1331
             .c('jingle', {
1327
                 xmlns: 'urn:xmpp:jingle:1',
1332
                 xmlns: 'urn:xmpp:jingle:1',
1328
                 action: 'source-remove',
1333
                 action: 'source-remove',
1348
 
1353
 
1349
         // send source-add IQ.
1354
         // send source-add IQ.
1350
         sdpDiffer = new SDPDiffer(old_sdp, new_sdp);
1355
         sdpDiffer = new SDPDiffer(old_sdp, new_sdp);
1351
-        const add = $iq({ to: this.peerjid, type: 'set' })
1356
+        const add = $iq({ to: this.peerjid,
1357
+            type: 'set' })
1352
             .c('jingle', {
1358
             .c('jingle', {
1353
                 xmlns: 'urn:xmpp:jingle:1',
1359
                 xmlns: 'urn:xmpp:jingle:1',
1354
                 action: 'source-add',
1360
                 action: 'source-add',

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

177
             tmp = lines[i].split(' ');
177
             tmp = lines[i].split(' ');
178
             const semantics = tmp.shift().substr(8);
178
             const semantics = tmp.shift().substr(8);
179
 
179
 
180
-            elem.c('group', { xmlns: 'urn:xmpp:jingle:apps:grouping:0', semantics });
180
+            elem.c('group', { xmlns: 'urn:xmpp:jingle:apps:grouping:0',
181
+                semantics });
181
             for (j = 0; j < tmp.length; j++) {
182
             for (j = 0; j < tmp.length; j++) {
182
                 elem.c('content', { name: tmp[j] }).up();
183
                 elem.c('content', { name: tmp[j] }).up();
183
             }
184
             }
199
             ssrc = false;
200
             ssrc = false;
200
         }
201
         }
201
 
202
 
202
-        elem.c('content', { creator: thecreator, name: mline.media });
203
+        elem.c('content', { creator: thecreator,
204
+            name: mline.media });
203
         const amidline = SDPUtil.find_line(this.media[i], 'a=mid:');
205
         const amidline = SDPUtil.find_line(this.media[i], 'a=mid:');
204
 
206
 
205
         if (amidline) {
207
         if (amidline) {
243
 
245
 
244
             if (ssrc) {
246
             if (ssrc) {
245
                 // new style mapping
247
                 // new style mapping
246
-                elem.c('source', { ssrc, xmlns: 'urn:xmpp:jingle:apps:rtp:ssma:0' });
248
+                elem.c('source', { ssrc,
249
+                    xmlns: 'urn:xmpp:jingle:apps:rtp:ssma:0' });
247
                 // FIXME: group by ssrc and support multiple different ssrcs
250
                 // FIXME: group by ssrc and support multiple different ssrcs
248
                 const ssrclines = SDPUtil.find_lines(this.media[i], 'a=ssrc:');
251
                 const ssrclines = SDPUtil.find_lines(this.media[i], 'a=ssrc:');
249
 
252
 
255
                         if (linessrc != ssrc) {
258
                         if (linessrc != ssrc) {
256
                             elem.up();
259
                             elem.up();
257
                             ssrc = linessrc;
260
                             ssrc = linessrc;
258
-                            elem.c('source', { ssrc, xmlns: 'urn:xmpp:jingle:apps:rtp:ssma:0' });
261
+                            elem.c('source', { ssrc,
262
+                                xmlns: 'urn:xmpp:jingle:apps:rtp:ssma:0' });
259
                         }
263
                         }
260
                         const kv = line.substr(idx + 1);
264
                         const kv = line.substr(idx + 1);
261
 
265
 
276
                     });
280
                     });
277
                 } else {
281
                 } else {
278
                     elem.up();
282
                     elem.up();
279
-                    elem.c('source', { ssrc, xmlns: 'urn:xmpp:jingle:apps:rtp:ssma:0' });
283
+                    elem.c('source', { ssrc,
284
+                        xmlns: 'urn:xmpp:jingle:apps:rtp:ssma:0' });
280
                     elem.c('parameter');
285
                     elem.c('parameter');
281
                     elem.attrs({
286
                     elem.attrs({
282
                         name: 'cname',
287
                         name: 'cname',
298
                     if (msid !== null) {
303
                     if (msid !== null) {
299
                         msid = SDPUtil.filter_special_chars(msid);
304
                         msid = SDPUtil.filter_special_chars(msid);
300
                         elem.c('parameter');
305
                         elem.c('parameter');
301
-                        elem.attrs({ name: 'msid', value: msid });
306
+                        elem.attrs({ name: 'msid',
307
+                            value: msid });
302
                         elem.up();
308
                         elem.up();
303
                         elem.c('parameter');
309
                         elem.c('parameter');
304
-                        elem.attrs({ name: 'mslabel', value: msid });
310
+                        elem.attrs({ name: 'mslabel',
311
+                            value: msid });
305
                         elem.up();
312
                         elem.up();
306
                         elem.c('parameter');
313
                         elem.c('parameter');
307
-                        elem.attrs({ name: 'label', value: msid });
314
+                        elem.attrs({ name: 'label',
315
+                            value: msid });
308
                         elem.up();
316
                         elem.up();
309
                     }
317
                     }
310
                 }
318
                 }
319
                     const ssrcs = line.substr(14 + semantics.length).split(' ');
327
                     const ssrcs = line.substr(14 + semantics.length).split(' ');
320
 
328
 
321
                     if (ssrcs.length) {
329
                     if (ssrcs.length) {
322
-                        elem.c('ssrc-group', { semantics, xmlns: 'urn:xmpp:jingle:apps:rtp:ssma:0' });
330
+                        elem.c('ssrc-group', { semantics,
331
+                            xmlns: 'urn:xmpp:jingle:apps:rtp:ssma:0' });
323
                         ssrcs.forEach(ssrc => elem.c('source', { ssrc }).up());
332
                         ssrcs.forEach(ssrc => elem.c('source', { ssrc }).up());
324
                         elem.up();
333
                         elem.up();
325
                     }
334
                     }
464
         const tmp = SDPUtil.parse_rtcpfb(line);
473
         const tmp = SDPUtil.parse_rtcpfb(line);
465
 
474
 
466
         if (tmp.type == 'trr-int') {
475
         if (tmp.type == 'trr-int') {
467
-            elem.c('rtcp-fb-trr-int', { xmlns: 'urn:xmpp:jingle:apps:rtp:rtcp-fb:0', value: tmp.params[0] });
476
+            elem.c('rtcp-fb-trr-int', { xmlns: 'urn:xmpp:jingle:apps:rtp:rtcp-fb:0',
477
+                value: tmp.params[0] });
468
             elem.up();
478
             elem.up();
469
         } else {
479
         } else {
470
-            elem.c('rtcp-fb', { xmlns: 'urn:xmpp:jingle:apps:rtp:rtcp-fb:0', type: tmp.type });
480
+            elem.c('rtcp-fb', { xmlns: 'urn:xmpp:jingle:apps:rtp:rtcp-fb:0',
481
+                type: tmp.type });
471
             if (tmp.params.length > 0) {
482
             if (tmp.params.length > 0) {
472
                 elem.attrs({ 'subtype': tmp.params[0] });
483
                 elem.attrs({ 'subtype': tmp.params[0] });
473
             }
484
             }

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

124
         modify.c('content', { name: media.mid });
124
         modify.c('content', { name: media.mid });
125
 
125
 
126
         modify.c('description',
126
         modify.c('description',
127
-                 { xmlns: 'urn:xmpp:jingle:apps:rtp:1', media: media.mid });
127
+            { xmlns: 'urn:xmpp:jingle:apps:rtp:1',
128
+                media: media.mid });
128
         // FIXME: not completely sure this operates on blocks and / or handles
129
         // FIXME: not completely sure this operates on blocks and / or handles
129
         // different ssrcs correctly
130
         // different ssrcs correctly
130
         // generate sources from lines
131
         // generate sources from lines

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

131
             const value = parts[i].split('=')[1];
131
             const value = parts[i].split('=')[1];
132
 
132
 
133
             if (key && value) {
133
             if (key && value) {
134
-                data.push({ name: key, value });
134
+                data.push({ name: key,
135
+                    value });
135
             } else if (key) {
136
             } else if (key) {
136
                 // rfc 4733 (DTMF) style stuff
137
                 // rfc 4733 (DTMF) style stuff
137
-                data.push({ name: '', value: key });
138
+                data.push({ name: '',
139
+                    value: key });
138
             }
140
             }
139
         }
141
         }
140
 
142
 

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

113
 
113
 
114
 Moderator.prototype.createConferenceIq = function() {
114
 Moderator.prototype.createConferenceIq = function() {
115
     // Generate create conference IQ
115
     // Generate create conference IQ
116
-    const elem = $iq({ to: this.getFocusComponent(), type: 'set' });
116
+    const elem = $iq({ to: this.getFocusComponent(),
117
+        type: 'set' });
117
 
118
 
118
     // Session Id used for authentication
119
     // Session Id used for authentication
119
     const sessionId = Settings.getSessionId();
120
     const sessionId = Settings.getSessionId();
433
  * @param failureCb
434
  * @param failureCb
434
  */
435
  */
435
 Moderator.prototype._getLoginUrl = function(popup, urlCb, failureCb) {
436
 Moderator.prototype._getLoginUrl = function(popup, urlCb, failureCb) {
436
-    const iq = $iq({ to: this.getFocusComponent(), type: 'get' });
437
+    const iq = $iq({ to: this.getFocusComponent(),
438
+        type: 'get' });
437
     const attrs = {
439
     const attrs = {
438
         xmlns: 'http://jitsi.org/protocol/focus',
440
         xmlns: 'http://jitsi.org/protocol/focus',
439
         room: this.roomName,
441
         room: this.roomName,
481
 };
483
 };
482
 
484
 
483
 Moderator.prototype.logout = function(callback) {
485
 Moderator.prototype.logout = function(callback) {
484
-    const iq = $iq({ to: this.getFocusComponent(), type: 'set' });
486
+    const iq = $iq({ to: this.getFocusComponent(),
487
+        type: 'set' });
485
     const sessionId = Settings.getSessionId();
488
     const sessionId = Settings.getSessionId();
486
 
489
 
487
     if (!sessionId) {
490
     if (!sessionId) {

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

94
 
94
 
95
     // FIXME jibri does not accept IQ without 'url' attribute set ?
95
     // FIXME jibri does not accept IQ without 'url' attribute set ?
96
         const iq
96
         const iq
97
-            = $iq({ to: this.focusMucJid, type: 'set' })
97
+            = $iq({ to: this.focusMucJid,
98
+                type: 'set' })
98
                 .c('jibri', {
99
                 .c('jibri', {
99
                     'xmlns': 'http://jitsi.org/protocol/jibri',
100
                     'xmlns': 'http://jitsi.org/protocol/jibri',
100
                     'action': state === Recording.status.ON
101
                     'action': state === Recording.status.ON
128
             errCallback(new Error('Invalid state!'));
129
             errCallback(new Error('Invalid state!'));
129
         }
130
         }
130
 
131
 
131
-        const iq = $iq({ to: this.jirecon, type: 'set' })
132
+        const iq = $iq({ to: this.jirecon,
133
+            type: 'set' })
132
         .c('recording', { xmlns: 'http://jitsi.org/protocol/jirecon',
134
         .c('recording', { xmlns: 'http://jitsi.org/protocol/jirecon',
133
             action: state === Recording.status.ON
135
             action: state === Recording.status.ON
134
                 ? Recording.action.START
136
                 ? Recording.action.START
171
 // with the new recording state, according to the IQ.
173
 // with the new recording state, according to the IQ.
172
 Recording.prototype.setRecordingColibri
174
 Recording.prototype.setRecordingColibri
173
 = function(state, callback, errCallback, options) {
175
 = function(state, callback, errCallback, options) {
174
-    const elem = $iq({ to: this.focusMucJid, type: 'set' });
176
+    const elem = $iq({ to: this.focusMucJid,
177
+        type: 'set' });
175
 
178
 
176
     elem.c('conference', {
179
     elem.c('conference', {
177
         xmlns: 'http://jitsi.org/protocol/colibri'
180
         xmlns: 'http://jitsi.org/protocol/colibri'
178
     });
181
     });
179
-    elem.c('recording', { state, token: options.token });
182
+    elem.c('recording', { state,
183
+        token: options.token });
180
 
184
 
181
     const self = this;
185
     const self = this;
182
 
186
 

+ 2
- 1
modules/xmpp/strophe.jingle.js 查看文件

192
         // TODO: implement refresh via updateIce as described in
192
         // TODO: implement refresh via updateIce as described in
193
         //      https://code.google.com/p/webrtc/issues/detail?id=1650
193
         //      https://code.google.com/p/webrtc/issues/detail?id=1650
194
         this.connection.sendIQ(
194
         this.connection.sendIQ(
195
-            $iq({ type: 'get', to: this.connection.domain })
195
+            $iq({ type: 'get',
196
+                to: this.connection.domain })
196
                 .c('services', { xmlns: 'urn:xmpp:extdisco:1' })
197
                 .c('services', { xmlns: 'urn:xmpp:extdisco:1' })
197
                 .c('service', { host: `turn.${this.connection.domain}` }),
198
                 .c('service', { host: `turn.${this.connection.domain}` }),
198
             res => {
199
             res => {

+ 2
- 1
modules/xmpp/strophe.ping.js 查看文件

57
      *        argument.
57
      *        argument.
58
      */
58
      */
59
     ping(jid, success, error, timeout) {
59
     ping(jid, success, error, timeout) {
60
-        const iq = $iq({ type: 'get', to: jid });
60
+        const iq = $iq({ type: 'get',
61
+            to: jid });
61
 
62
 
62
         iq.c('ping', { xmlns: Strophe.NS.PING });
63
         iq.c('ping', { xmlns: Strophe.NS.PING });
63
         this.connection.sendIQ(iq, success, error, timeout);
64
         this.connection.sendIQ(iq, success, error, timeout);

正在加载...
取消
保存