소스 검색

[eslint] max-params

dev1
Lyubo Marinov 8 년 전
부모
커밋
66b62080e8

+ 1
- 0
.eslintrc.js 파일 보기

@@ -191,6 +191,7 @@ module.exports = {
191 191
         'max-len': [ 'error', 80 ],
192 192
         'max-lines': 0,
193 193
         'max-nested-callbacks': 2,
194
+        'max-params': 2,
194 195
         'max-statements': 0,
195 196
         'max-statements-per-line': 2,
196 197
         'multiline-ternary': 0,

+ 60
- 38
JitsiConference.js 파일 보기

@@ -675,6 +675,8 @@ JitsiConference.prototype._setupNewTrack = function(newTrack) {
675 675
     this.eventEmitter.emit(JitsiConferenceEvents.TRACK_ADDED, newTrack);
676 676
 };
677 677
 
678
+/* eslint-disable max-params */
679
+
678 680
 /**
679 681
  * Adds loca WebRTC stream to the conference.
680 682
  * @param {MediaStream} stream new stream that will be added.
@@ -688,17 +690,25 @@ JitsiConference.prototype._setupNewTrack = function(newTrack) {
688 690
  * called. The option is used for adding stream, before the Jingle call is
689 691
  * started. That is before the 'session-accept' is sent.
690 692
  */
691
-JitsiConference.prototype._addLocalStream
692
-    = function(stream, callback, errorCallback, ssrcInfo, dontModifySources) {
693
-        if (this.jingleSession) {
694
-            this.jingleSession.addStream(
695
-            stream, callback, errorCallback, ssrcInfo, dontModifySources);
696
-        } else {
693
+JitsiConference.prototype._addLocalStream = function(
694
+        stream,
695
+        callback,
696
+        errorCallback,
697
+        ssrcInfo,
698
+        dontModifySources) {
699
+    if (this.jingleSession) {
700
+        this.jingleSession.addStream(
701
+            stream,
702
+            callback,
703
+            errorCallback,
704
+            ssrcInfo,
705
+            dontModifySources);
706
+    } else {
697 707
         // We are done immediately
698
-            logger.warn('Add local MediaStream - no JingleSession started yet');
699
-            callback();
700
-        }
701
-    };
708
+        logger.warn('Add local MediaStream - no JingleSession started yet');
709
+        callback();
710
+    }
711
+};
702 712
 
703 713
 /**
704 714
  * Remove local WebRTC media stream.
@@ -708,18 +718,25 @@ JitsiConference.prototype._addLocalStream
708 718
  * @param {object} ssrcInfo object with information about the SSRCs associated
709 719
  * with the stream.
710 720
  */
711
-JitsiConference.prototype.removeLocalStream
712
-    = function(stream, callback, errorCallback, ssrcInfo) {
713
-        if (this.jingleSession) {
714
-            this.jingleSession.removeStream(
715
-            stream, callback, errorCallback, ssrcInfo);
716
-        } else {
717
-            // We are done immediately
718
-            logger.warn(
719
-                'Remove local MediaStream - no JingleSession started yet');
720
-            callback();
721
-        }
722
-    };
721
+JitsiConference.prototype.removeLocalStream = function(
722
+        stream,
723
+        callback,
724
+        errorCallback,
725
+        ssrcInfo) {
726
+    if (this.jingleSession) {
727
+        this.jingleSession.removeStream(
728
+            stream,
729
+            callback,
730
+            errorCallback,
731
+            ssrcInfo);
732
+    } else {
733
+        // We are done immediately
734
+        logger.warn('Remove local MediaStream - no JingleSession started yet');
735
+        callback();
736
+    }
737
+};
738
+
739
+/* eslint-enable max-params */
723 740
 
724 741
 /**
725 742
  * Generate ssrc info object for a stream with the following properties:
@@ -887,6 +904,8 @@ JitsiConference.prototype.muteParticipant = function(id) {
887 904
     this.room.muteParticipant(participant.getJid(), true);
888 905
 };
889 906
 
907
+/* eslint-disable max-params */
908
+
890 909
 /**
891 910
  * Notifies this JitsiConference that a new member has joined its chat room.
892 911
  *
@@ -898,26 +917,29 @@ JitsiConference.prototype.muteParticipant = function(id) {
898 917
  * @param isHidden indicates if this is a hidden participant (system
899 918
  * participant for example a recorder).
900 919
  */
901
-JitsiConference.prototype.onMemberJoined
902
-    = function(jid, nick, role, isHidden) {
903
-        const id = Strophe.getResourceFromJid(jid);
920
+JitsiConference.prototype.onMemberJoined = function(jid, nick, role, isHidden) {
921
+    const id = Strophe.getResourceFromJid(jid);
904 922
 
905
-        if (id === 'focus' || this.myUserId() === id) {
906
-            return;
907
-        }
908
-        const participant = new JitsiParticipant(jid, this, nick, isHidden);
923
+    if (id === 'focus' || this.myUserId() === id) {
924
+        return;
925
+    }
926
+    const participant = new JitsiParticipant(jid, this, nick, isHidden);
909 927
 
910
-        participant._role = role;
911
-        this.participants[id] = participant;
912
-        this.eventEmitter.emit(
913
-            JitsiConferenceEvents.USER_JOINED,
914
-            id,
915
-            participant);
916
-        this.xmpp.caps.getFeatures(jid).then(features => {
928
+    participant._role = role;
929
+    this.participants[id] = participant;
930
+    this.eventEmitter.emit(
931
+        JitsiConferenceEvents.USER_JOINED,
932
+        id,
933
+        participant);
934
+    this.xmpp.caps.getFeatures(jid)
935
+        .then(features => {
917 936
             participant._supportsDTMF = features.has('urn:xmpp:jingle:dtmf:0');
918 937
             this.updateDTMFSupport();
919
-        }, error => logger.error(error));
920
-    };
938
+        },
939
+        error => logger.error(error));
940
+};
941
+
942
+/* eslint-enable max-params */
921 943
 
922 944
 JitsiConference.prototype.onMemberLeft = function(jid) {
923 945
     const id = Strophe.getResourceFromJid(jid);

+ 6
- 2
JitsiConferenceEventManager.js 파일 보기

@@ -256,11 +256,15 @@ JitsiConferenceEventManager.prototype.setupChatRoomListeners = function() {
256 256
                 authIdentity);
257 257
         });
258 258
 
259
-    chatRoom.addListener(XMPPEvents.MESSAGE_RECEIVED,
259
+    chatRoom.addListener(
260
+        XMPPEvents.MESSAGE_RECEIVED,
261
+
262
+        // eslint-disable-next-line max-params
260 263
         (jid, displayName, txt, myJid, ts) => {
261 264
             const id = Strophe.getResourceFromJid(jid);
262 265
 
263
-            conference.eventEmitter.emit(JitsiConferenceEvents.MESSAGE_RECEIVED,
266
+            conference.eventEmitter.emit(
267
+                JitsiConferenceEvents.MESSAGE_RECEIVED,
264 268
                 id, txt, ts);
265 269
         });
266 270
 

+ 4
- 0
JitsiMeetJS.js 파일 보기

@@ -390,6 +390,8 @@ const LibJitsiMeet = {
390 390
         this.mediaDevices.enumerateDevices(callback);
391 391
     },
392 392
 
393
+    /* eslint-disable max-params */
394
+
393 395
     /**
394 396
      * @returns function that can be used to be attached to window.onerror and
395 397
      * if options.enableWindowOnErrorHandler is enabled returns
@@ -406,6 +408,8 @@ const LibJitsiMeet = {
406 408
         Statistics.reportGlobalError(error);
407 409
     },
408 410
 
411
+    /* eslint-enable max-params */
412
+
409 413
     /**
410 414
      * Returns current machine id saved from the local storage.
411 415
      * @returns {string} the machine id

+ 5
- 0
JitsiParticipant.js 파일 보기

@@ -6,6 +6,9 @@ import * as MediaType from './service/RTC/MediaType';
6 6
  * Represents a participant in (i.e. a member of) a conference.
7 7
  */
8 8
 export default class JitsiParticipant {
9
+
10
+    /* eslint-disable max-params */
11
+
9 12
     /**
10 13
      * Initializes a new JitsiParticipant instance.
11 14
      *
@@ -34,6 +37,8 @@ export default class JitsiParticipant {
34 37
         this._properties = {};
35 38
     }
36 39
 
40
+    /* eslint-enable max-params */
41
+
37 42
     /**
38 43
      * @returns {JitsiConference} The conference that this participant belongs
39 44
      * to.

+ 31
- 18
modules/RTC/JitsiLocalTrack.js 파일 보기

@@ -15,6 +15,8 @@ import VideoType from '../../service/RTC/VideoType';
15 15
 
16 16
 const logger = getLogger(__filename);
17 17
 
18
+/* eslint-disable max-params */
19
+
18 20
 /**
19 21
  * Represents a single media track(either audio or video).
20 22
  * One <tt>JitsiLocalTrack</tt> corresponds to one WebRTC MediaStreamTrack.
@@ -27,20 +29,28 @@ const logger = getLogger(__filename);
27 29
  * @param facingMode the camera facing mode used in getUserMedia call
28 30
  * @constructor
29 31
  */
30
-function JitsiLocalTrack(stream, track, mediaType, videoType, resolution,
31
-                         deviceId, facingMode) {
32
-    const self = this;
33
-
34
-    JitsiTrack.call(this,
35
-        null /* RTC */, stream, track,
32
+function JitsiLocalTrack(
33
+        stream,
34
+        track,
35
+        mediaType,
36
+        videoType,
37
+        resolution,
38
+        deviceId,
39
+        facingMode) {
40
+    JitsiTrack.call(
41
+        this,
42
+        null /* RTC */,
43
+        stream,
44
+        track,
36 45
         () => {
37 46
             if (!this.dontFireRemoveEvent) {
38
-                this.eventEmitter.emit(
39
-                    JitsiTrackEvents.LOCAL_TRACK_STOPPED);
47
+                this.eventEmitter.emit(JitsiTrackEvents.LOCAL_TRACK_STOPPED);
40 48
             }
41 49
             this.dontFireRemoveEvent = false;
42 50
         } /* inactiveHandler */,
43
-        mediaType, videoType, null /* ssrc */);
51
+        mediaType,
52
+        videoType,
53
+        null /* ssrc */);
44 54
     this.dontFireRemoveEvent = false;
45 55
     this.resolution = resolution;
46 56
 
@@ -98,16 +108,16 @@ function JitsiLocalTrack(stream, track, mediaType, videoType, resolution,
98 108
      */
99 109
     this._noDataFromSourceTimeout = null;
100 110
 
101
-    this._onDeviceListChanged = function(devices) {
102
-        self._setRealDeviceIdFromDeviceList(devices);
111
+    this._onDeviceListChanged = devices => {
112
+        this._setRealDeviceIdFromDeviceList(devices);
103 113
 
104 114
         // Mark track as ended for those browsers that do not support
105 115
         // "readyState" property. We do not touch tracks created with default
106 116
         // device ID "".
107
-        if (typeof self.getTrack().readyState === 'undefined'
108
-            && typeof self._realDeviceId !== 'undefined'
109
-            && !devices.find(d => d.deviceId === self._realDeviceId)) {
110
-            self._trackEnded = true;
117
+        if (typeof this.getTrack().readyState === 'undefined'
118
+                && typeof this._realDeviceId !== 'undefined'
119
+                && !devices.find(d => d.deviceId === this._realDeviceId)) {
120
+            this._trackEnded = true;
111 121
         }
112 122
     };
113 123
 
@@ -117,17 +127,20 @@ function JitsiLocalTrack(stream, track, mediaType, videoType, resolution,
117 127
     // because there might be local tracks not attached to a conference.
118 128
     if (this.isAudioTrack() && RTCUtils.isDeviceChangeAvailable('output')) {
119 129
         this._onAudioOutputDeviceChanged = this.setAudioOutput.bind(this);
120
-
121
-        RTCUtils.addListener(RTCEvents.AUDIO_OUTPUT_DEVICE_CHANGED,
130
+        RTCUtils.addListener(
131
+            RTCEvents.AUDIO_OUTPUT_DEVICE_CHANGED,
122 132
             this._onAudioOutputDeviceChanged);
123 133
     }
124 134
 
125
-    RTCUtils.addListener(RTCEvents.DEVICE_LIST_CHANGED,
135
+    RTCUtils.addListener(
136
+        RTCEvents.DEVICE_LIST_CHANGED,
126 137
         this._onDeviceListChanged);
127 138
 
128 139
     this._initNoDataFromSourceHandlers();
129 140
 }
130 141
 
142
+/* eslint-enable max-params */
143
+
131 144
 JitsiLocalTrack.prototype = Object.create(JitsiTrack.prototype);
132 145
 JitsiLocalTrack.prototype.constructor = JitsiLocalTrack;
133 146
 

+ 14
- 2
modules/RTC/JitsiRemoteTrack.js 파일 보기

@@ -9,6 +9,8 @@ const Statistics = require('../statistics/statistics');
9 9
 let ttfmTrackerAudioAttached = false;
10 10
 let ttfmTrackerVideoAttached = false;
11 11
 
12
+/* eslint-disable max-params */
13
+
12 14
 /**
13 15
  * Represents a single media track (either audio or video).
14 16
  * @param {RTC} rtc the RTC service instance.
@@ -24,8 +26,16 @@ let ttfmTrackerVideoAttached = false;
24 26
  * @param {boolean} muted the initial muted state
25 27
  * @constructor
26 28
  */
27
-function JitsiRemoteTrack(rtc, conference, ownerEndpointId, stream, track,
28
-                          mediaType, videoType, ssrc, muted) {
29
+function JitsiRemoteTrack(
30
+        rtc,
31
+        conference,
32
+        ownerEndpointId,
33
+        stream,
34
+        track,
35
+        mediaType,
36
+        videoType,
37
+        ssrc,
38
+        muted) {
29 39
     JitsiTrack.call(
30 40
         this,
31 41
         conference,
@@ -52,6 +62,8 @@ function JitsiRemoteTrack(rtc, conference, ownerEndpointId, stream, track,
52 62
     }
53 63
 }
54 64
 
65
+/* eslint-enable max-params */
66
+
55 67
 JitsiRemoteTrack.prototype = Object.create(JitsiTrack.prototype);
56 68
 JitsiRemoteTrack.prototype.constructor = JitsiRemoteTrack;
57 69
 

+ 4
- 0
modules/RTC/JitsiTrack.js 파일 보기

@@ -54,6 +54,8 @@ function addMediaStreamInactiveHandler(mediaStream, handler) {
54 54
     }
55 55
 }
56 56
 
57
+/* eslint-disable max-params */
58
+
57 59
 /**
58 60
  * Represents a single media track (either audio or video).
59 61
  * @constructor
@@ -101,6 +103,8 @@ function JitsiTrack(
101 103
     this._setHandler('inactive', streamInactiveHandler);
102 104
 }
103 105
 
106
+/* eslint-enable max-params */
107
+
104 108
 /**
105 109
  * Sets handler to the WebRTC MediaStream or MediaStreamTrack object depending
106 110
  * on the passed type.

+ 24
- 5
modules/RTC/RTC.js 파일 보기

@@ -411,6 +411,8 @@ export default class RTC extends Listenable {
411 411
         this.localTracks.splice(pos, 1);
412 412
     }
413 413
 
414
+    /* eslint-disable max-params */
415
+
414 416
     /**
415 417
      * Initializes a new JitsiRemoteTrack instance with the data provided by
416 418
      * the signaling layer and SDP.
@@ -423,25 +425,42 @@ export default class RTC extends Listenable {
423 425
      * @param {string} ssrc
424 426
      * @param {boolean} muted
425 427
      */
426
-    _createRemoteTrack(ownerEndpointId,
427
-                        stream, track, mediaType, videoType, ssrc, muted) {
428
+    _createRemoteTrack(
429
+            ownerEndpointId,
430
+            stream,
431
+            track,
432
+            mediaType,
433
+            videoType,
434
+            ssrc,
435
+            muted) {
428 436
         const remoteTrack
429 437
             = new JitsiRemoteTrack(
430
-                this, this.conference, ownerEndpointId, stream, track,
431
-                mediaType, videoType, ssrc, muted);
438
+                this,
439
+                this.conference,
440
+                ownerEndpointId,
441
+                stream,
442
+                track,
443
+                mediaType,
444
+                videoType,
445
+                ssrc,
446
+                muted);
432 447
         const remoteTracks
433 448
             = this.remoteTracks[ownerEndpointId]
434 449
                 || (this.remoteTracks[ownerEndpointId] = {});
435 450
 
436 451
         if (remoteTracks[mediaType]) {
437 452
             logger.error(
438
-                'Overwriting remote track!', ownerEndpointId, mediaType);
453
+                'Overwriting remote track!',
454
+                ownerEndpointId,
455
+                mediaType);
439 456
         }
440 457
         remoteTracks[mediaType] = remoteTrack;
441 458
 
442 459
         this.eventEmitter.emit(RTCEvents.REMOTE_TRACK_ADDED, remoteTrack);
443 460
     }
444 461
 
462
+    /* eslint-enable max-params */
463
+
445 464
     /**
446 465
      * Removes all JitsiRemoteTracks associated with given MUC nickname
447 466
      * (resource part of the JID). Returns array of removed tracks.

+ 4
- 0
modules/RTC/RTCUtils.js 파일 보기

@@ -894,6 +894,8 @@ class RTCUtils extends Listenable {
894 894
         });
895 895
     }
896 896
 
897
+    /* eslint-disable max-params */
898
+
897 899
     /**
898 900
     * @param {string[]} um required user media types
899 901
     * @param {function} successCallback
@@ -942,6 +944,8 @@ class RTCUtils extends Listenable {
942 944
         }
943 945
     }
944 946
 
947
+    /* eslint-enable max-params */
948
+
945 949
     /**
946 950
      * Creates the local MediaStreams.
947 951
      * @param {Object} [options] optional parameters

+ 4
- 0
modules/RTC/ScreenObtainer.js 파일 보기

@@ -290,6 +290,8 @@ const ScreenObtainer = {
290 290
         }
291 291
     },
292 292
 
293
+    /* eslint-disable max-params */
294
+
293 295
     handleExtensionInstallationError(options, streamCallback, failCallback, e) {
294 296
         const webStoreInstallUrl = getWebStoreInstallUrl(this.options);
295 297
 
@@ -314,6 +316,8 @@ const ScreenObtainer = {
314 316
             msg));
315 317
     },
316 318
 
319
+    /* eslint-enable max-params */
320
+
317 321
     checkForChromeExtensionOnInterval(options, streamCallback, failCallback) {
318 322
         if (options.checkAgain() === false) {
319 323
             failCallback(new JitsiTrackError(

+ 50
- 46
modules/RTC/TraceablePeerConnection.js 파일 보기

@@ -17,6 +17,8 @@ import transform from 'sdp-transform';
17 17
 const logger = getLogger(__filename);
18 18
 const SIMULCAST_LAYERS = 3;
19 19
 
20
+/* eslint-disable max-params */
21
+
20 22
 /**
21 23
  * Creates new instance of 'TraceablePeerConnection'.
22 24
  *
@@ -39,16 +41,19 @@ const SIMULCAST_LAYERS = 3;
39 41
  *
40 42
  * @constructor
41 43
  */
42
-function TraceablePeerConnection(rtc, id, signalingLayer, iceConfig,
43
-                                 constraints, options) {
44
-    const self = this;
44
+function TraceablePeerConnection(
45
+        rtc,
46
+        id,
47
+        signalingLayer,
48
+        iceConfig,
49
+        constraints,
50
+        options) {
45 51
 
46 52
     /**
47 53
      * The parent instance of RTC service which created this
48 54
      * <tt>TracablePeerConnection</tt>.
49 55
      * @type {RTC}
50 56
      */
51
-
52 57
     this.rtc = rtc;
53 58
 
54 59
     /**
@@ -98,7 +103,7 @@ function TraceablePeerConnection(rtc, id, signalingLayer, iceConfig,
98 103
     this.rtxModifier = new RtxModifier();
99 104
 
100 105
     // override as desired
101
-    this.trace = function(what, info) {
106
+    this.trace = (what, info) => {
102 107
         /* logger.warn('WTRACE', what, info);
103 108
         if (info && RTCBrowserType.isIExplorer()) {
104 109
             if (info.length > 1024) {
@@ -108,78 +113,76 @@ function TraceablePeerConnection(rtc, id, signalingLayer, iceConfig,
108 113
                 logger.warn('WTRACE', what, info.substr(2048));
109 114
             }
110 115
         }*/
111
-        self.updateLog.push({
116
+        this.updateLog.push({
112 117
             time: new Date(),
113 118
             type: what,
114 119
             value: info || ''
115 120
         });
116 121
     };
117 122
     this.onicecandidate = null;
118
-    this.peerconnection.onicecandidate = function(event) {
123
+    this.peerconnection.onicecandidate = event => {
119 124
         // FIXME: this causes stack overflow with Temasys Plugin
120 125
         if (!RTCBrowserType.isTemasysPluginUsed()) {
121
-            self.trace(
126
+            this.trace(
122 127
                 'onicecandidate',
123 128
                 JSON.stringify(event.candidate, null, ' '));
124 129
         }
125 130
 
126
-        if (self.onicecandidate !== null) {
127
-            self.onicecandidate(event);
131
+        if (this.onicecandidate !== null) {
132
+            this.onicecandidate(event);
128 133
         }
129 134
     };
130 135
     this.onaddstream = null;
131
-    this.peerconnection.onaddstream = function(event) {
132
-        self.trace('onaddstream', event.stream.id);
133
-        if (self.onaddstream !== null) {
134
-            self.onaddstream(event);
136
+    this.peerconnection.onaddstream = event => {
137
+        this.trace('onaddstream', event.stream.id);
138
+        if (this.onaddstream !== null) {
139
+            this.onaddstream(event);
135 140
         }
136 141
     };
137 142
     this.onremovestream = null;
138
-    this.peerconnection.onremovestream = function(event) {
139
-        self.trace('onremovestream', event.stream.id);
140
-        if (self.onremovestream !== null) {
141
-            self.onremovestream(event);
143
+    this.peerconnection.onremovestream = event => {
144
+        this.trace('onremovestream', event.stream.id);
145
+        if (this.onremovestream !== null) {
146
+            this.onremovestream(event);
142 147
         }
143 148
     };
144
-    this.peerconnection.onaddstream = function(event) {
145
-        self._remoteStreamAdded(event.stream);
146
-    };
147
-    this.peerconnection.onremovestream = function(event) {
148
-        self._remoteStreamRemoved(event.stream);
149
-    };
149
+    this.peerconnection.onaddstream
150
+        = event => this._remoteStreamAdded(event.stream);
151
+    this.peerconnection.onremovestream
152
+        = event => this._remoteStreamRemoved(event.stream);
150 153
     this.onsignalingstatechange = null;
151
-    this.peerconnection.onsignalingstatechange = function(event) {
152
-        self.trace('onsignalingstatechange', self.signalingState);
153
-        if (self.onsignalingstatechange !== null) {
154
-            self.onsignalingstatechange(event);
154
+    this.peerconnection.onsignalingstatechange = event => {
155
+        this.trace('onsignalingstatechange', this.signalingState);
156
+        if (this.onsignalingstatechange !== null) {
157
+            this.onsignalingstatechange(event);
155 158
         }
156 159
     };
157 160
     this.oniceconnectionstatechange = null;
158
-    this.peerconnection.oniceconnectionstatechange = function(event) {
159
-        self.trace('oniceconnectionstatechange', self.iceConnectionState);
160
-        if (self.oniceconnectionstatechange !== null) {
161
-            self.oniceconnectionstatechange(event);
161
+    this.peerconnection.oniceconnectionstatechange = event => {
162
+        this.trace('oniceconnectionstatechange', this.iceConnectionState);
163
+        if (this.oniceconnectionstatechange !== null) {
164
+            this.oniceconnectionstatechange(event);
162 165
         }
163 166
     };
164 167
     this.onnegotiationneeded = null;
165
-    this.peerconnection.onnegotiationneeded = function(event) {
166
-        self.trace('onnegotiationneeded');
167
-        if (self.onnegotiationneeded !== null) {
168
-            self.onnegotiationneeded(event);
168
+    this.peerconnection.onnegotiationneeded = event => {
169
+        this.trace('onnegotiationneeded');
170
+        if (this.onnegotiationneeded !== null) {
171
+            this.onnegotiationneeded(event);
169 172
         }
170 173
     };
171
-    self.ondatachannel = null;
172
-    this.peerconnection.ondatachannel = function(event) {
173
-        self.trace('ondatachannel', event);
174
-        if (self.ondatachannel !== null) {
175
-            self.ondatachannel(event);
174
+    this.ondatachannel = null;
175
+    this.peerconnection.ondatachannel = event => {
176
+        this.trace('ondatachannel', event);
177
+        if (this.ondatachannel !== null) {
178
+            this.ondatachannel(event);
176 179
         }
177 180
     };
178 181
 
179 182
     // XXX: do all non-firefox browsers which we support also support this?
180 183
     if (!RTCBrowserType.isFirefox() && this.maxstats) {
181 184
         this.statsinterval = window.setInterval(() => {
182
-            self.peerconnection.getStats(stats => {
185
+            this.peerconnection.getStats(stats => {
183 186
                 const results = stats.result();
184 187
                 const now = new Date();
185 188
 
@@ -187,10 +190,10 @@ function TraceablePeerConnection(rtc, id, signalingLayer, iceConfig,
187 190
                     results[i].names().forEach(name => {
188 191
                         // eslint-disable-next-line no-shadow
189 192
                         const id = `${results[i].id}-${name}`;
190
-                        let s = self.stats[id];
193
+                        let s = this.stats[id];
191 194
 
192 195
                         if (!s) {
193
-                            self.stats[id] = s = {
196
+                            this.stats[id] = s = {
194 197
                                 startTime: now,
195 198
                                 endTime: now,
196 199
                                 values: [],
@@ -199,7 +202,7 @@ function TraceablePeerConnection(rtc, id, signalingLayer, iceConfig,
199 202
                         }
200 203
                         s.values.push(results[i].stat(name));
201 204
                         s.times.push(now.getTime());
202
-                        if (s.values.length > self.maxstats) {
205
+                        if (s.values.length > this.maxstats) {
203 206
                             s.values.shift();
204 207
                             s.times.shift();
205 208
                         }
@@ -207,11 +210,12 @@ function TraceablePeerConnection(rtc, id, signalingLayer, iceConfig,
207 210
                     });
208 211
                 }
209 212
             });
210
-
211 213
         }, 1000);
212 214
     }
213 215
 }
214 216
 
217
+/* eslint-enable max-params */
218
+
215 219
 /**
216 220
  * Returns a string representation of a SessionDescription object.
217 221
  */

+ 9
- 2
modules/statistics/CallStats.js 파일 보기

@@ -181,6 +181,8 @@ CallStats.prototype.pcCallback = tryCatch((err, msg) => {
181 181
     }
182 182
 });
183 183
 
184
+/* eslint-disable max-params */
185
+
184 186
 /**
185 187
  * Lets CallStats module know where is given SSRC rendered by providing renderer
186 188
  * tag ID.
@@ -193,8 +195,11 @@ CallStats.prototype.pcCallback = tryCatch((err, msg) => {
193 195
  * @param containerId {string} the id of media 'audio' or 'video' tag which
194 196
  *        renders the stream.
195 197
  */
196
-CallStats.prototype.associateStreamWithVideoTag
197
-= function(ssrc, isLocal, usageLabel, containerId) {
198
+CallStats.prototype.associateStreamWithVideoTag = function(
199
+        ssrc,
200
+        isLocal,
201
+        usageLabel,
202
+        containerId) {
198 203
     if (!callStats) {
199 204
         return;
200 205
     }
@@ -234,6 +239,8 @@ CallStats.prototype.associateStreamWithVideoTag
234 239
     }).bind(this)();
235 240
 };
236 241
 
242
+/* eslint-enable max-params */
243
+
237 244
 /**
238 245
  * Notifies CallStats for mute events
239 246
  * @param mute {boolean} true for muted and false for not muted

+ 4
- 0
modules/statistics/RTPStatsCollector.js 파일 보기

@@ -149,6 +149,8 @@ function ConferenceStats() {
149 149
     this.transport = [];
150 150
 }
151 151
 
152
+/* eslint-disable max-params */
153
+
152 154
 /**
153 155
  * <tt>StatsCollector</tt> registers for stats updates of given
154 156
  * <tt>peerconnection</tt> in given <tt>interval</tt>. On each update particular
@@ -218,6 +220,8 @@ function StatsCollector(
218 220
     this.ssrc2stats = {};
219 221
 }
220 222
 
223
+/* eslint-enable max-params */
224
+
221 225
 module.exports = StatsCollector;
222 226
 
223 227
 /**

+ 15
- 7
modules/statistics/statistics.js 파일 보기

@@ -321,6 +321,8 @@ Statistics.sendActiveDeviceListEvent = function(devicesData) {
321 321
     }
322 322
 };
323 323
 
324
+/* eslint-disable max-params */
325
+
324 326
 /**
325 327
  * Lets the underlying statistics module know where is given SSRC rendered by
326 328
  * providing renderer tag ID.
@@ -332,13 +334,19 @@ Statistics.sendActiveDeviceListEvent = function(devicesData) {
332 334
  * @param containerId {string} the id of media 'audio' or 'video' tag which
333 335
  *        renders the stream.
334 336
  */
335
-Statistics.prototype.associateStreamWithVideoTag
336
-= function(ssrc, isLocal, usageLabel, containerId) {
337
-    if (this.callstats) {
338
-        this.callstats.associateStreamWithVideoTag(
339
-            ssrc, isLocal, usageLabel, containerId);
340
-    }
341
-};
337
+Statistics.prototype.associateStreamWithVideoTag = function(
338
+        ssrc,
339
+        isLocal,
340
+        usageLabel,
341
+        containerId) {
342
+    this.callstats && this.callstats.associateStreamWithVideoTag(
343
+        ssrc,
344
+        isLocal,
345
+        usageLabel,
346
+        containerId);
347
+};
348
+
349
+/* eslint-enable max-params */
342 350
 
343 351
 /**
344 352
  * Notifies CallStats that getUserMedia failed.

+ 4
- 0
modules/transcription/recordingResult.js 파일 보기

@@ -1,3 +1,5 @@
1
+/* eslint-disable max-params */
2
+
1 3
 /**
2 4
  * This object stores variables needed around the recording of an audio stream
3 5
  * and passing this recording along with additional information along to
@@ -15,4 +17,6 @@ const RecordingResult = function(blob, name, startTime, wordArray) {
15 17
     this.wordArray = wordArray;
16 18
 };
17 19
 
20
+/* eslint-enable max-params */
21
+
18 22
 module.exports = RecordingResult;

+ 3
- 5
modules/util/GlobalOnErrorHandler.js 파일 보기

@@ -18,11 +18,9 @@ const oldOnErrorHandler = window.onerror;
18 18
  * Custom error handler that calls the old global error handler and executes
19 19
  * all handlers that were previously added.
20 20
  */
21
-function JitsiGlobalErrorHandler(message, source, lineno, colno, error) {
22
-    handlers.forEach(handler => handler(message, source, lineno, colno, error));
23
-    if (oldOnErrorHandler) {
24
-        oldOnErrorHandler(message, source, lineno, colno, error);
25
-    }
21
+function JitsiGlobalErrorHandler(...args) {
22
+    handlers.forEach(handler => handler(...args));
23
+    oldOnErrorHandler && oldOnErrorHandler(...args);
26 24
 }
27 25
 
28 26
 // If an old handler exists, also fire its events.

+ 10
- 2
modules/util/ScriptUtil.js 파일 보기

@@ -1,5 +1,6 @@
1 1
 const currentExecutingScript = require('current-executing-script');
2 2
 
3
+/* eslint-disable max-params */
3 4
 
4 5
 /**
5 6
  * Implements utility functions which facilitate the dealing with scripts such
@@ -21,8 +22,13 @@ const ScriptUtil = {
21 22
      * @param loadCallback on load callback function
22 23
      * @param errorCallback callback to be called on error loading the script
23 24
      */
24
-    loadScript(src, async, prepend, relativeURL,
25
-                          loadCallback, errorCallback) {
25
+    loadScript(
26
+            src,
27
+            async,
28
+            prepend,
29
+            relativeURL,
30
+            loadCallback,
31
+            errorCallback) {
26 32
         const d = document;
27 33
         const tagName = 'script';
28 34
         const script = d.createElement(tagName);
@@ -63,4 +69,6 @@ const ScriptUtil = {
63 69
     }
64 70
 };
65 71
 
72
+/* eslint-enable max-params */
73
+
66 74
 module.exports = ScriptUtil;

+ 9
- 0
modules/xmpp/ChatRoom.js 파일 보기

@@ -77,6 +77,9 @@ function filterNodeFromPresenceJSON(pres, nodeName) {
77 77
 /* eslint-disable newline-per-chained-call */
78 78
 
79 79
 export default class ChatRoom extends Listenable {
80
+
81
+    /* eslint-disable max-params */
82
+
80 83
     constructor(connection, jid, password, XMPP, options) {
81 84
         super();
82 85
         this.xmpp = XMPP;
@@ -108,6 +111,8 @@ export default class ChatRoom extends Listenable {
108 111
         this.locked = false;
109 112
     }
110 113
 
114
+    /* eslint-enable max-params */
115
+
111 116
     initPresenceMap() {
112 117
         this.presMap.to = this.myroomjid;
113 118
         this.presMap.xns = 'http://jabber.org/protocol/muc';
@@ -717,6 +722,8 @@ export default class ChatRoom extends Listenable {
717 722
             error => logger.log('Kick participant error: ', error));
718 723
     }
719 724
 
725
+    /* eslint-disable max-params */
726
+
720 727
     lockRoom(key, onSuccess, onError, onNotSupported) {
721 728
         // http://xmpp.org/extensions/xep-0045.html#roomconfig
722 729
         this.connection.sendIQ(
@@ -775,6 +782,8 @@ export default class ChatRoom extends Listenable {
775 782
             onError);
776 783
     }
777 784
 
785
+    /* eslint-enable max-params */
786
+
778 787
     addToPresence(key, values) {
779 788
         values.tagName = key;
780 789
         this.removeFromPresence(key);

+ 12
- 3
modules/xmpp/JingleSession.js 파일 보기

@@ -11,6 +11,8 @@ const logger = getLogger(__filename);
11 11
  */
12 12
 export default class JingleSession {
13 13
 
14
+    /* eslint-disable max-params */
15
+
14 16
     /**
15 17
      * Creates new <tt>JingleSession</tt>.
16 18
      * @param {string} sid the Jingle session identifier
@@ -22,8 +24,13 @@ export default class JingleSession {
22 24
      * @param {Object} iceConfig the ICE servers config object as defined by
23 25
      * the WebRTC. Passed to the PeerConnection's constructor.
24 26
      */
25
-    constructor(sid,
26
-                localJid, peerjid, connection, mediaConstraints, iceConfig) {
27
+    constructor(
28
+            sid,
29
+            localJid,
30
+            peerjid,
31
+            connection,
32
+            mediaConstraints,
33
+            iceConfig) {
27 34
         this.sid = sid;
28 35
         this.localJid = localJid;
29 36
         this.peerjid = peerjid;
@@ -61,6 +68,8 @@ export default class JingleSession {
61 68
         this.rtc = null;
62 69
     }
63 70
 
71
+    /* eslint-enable max-params */
72
+
64 73
     /**
65 74
      * Prepares this object to initiate a session.
66 75
      * @param {boolean} isInitiator whether we will be the Jingle initiator.
@@ -133,7 +142,7 @@ export default class JingleSession {
133 142
      * @param failure a callback called when either timeout occurs or ERROR
134 143
      * response is received.
135 144
      */
136
-    // eslint-disable-next-line no-unused-vars, no-empty-function
145
+    // eslint-disable-next-line max-params, no-unused-vars, no-empty-function
137 146
     terminate(reason, text, success, failure) { }
138 147
 
139 148
     /**

+ 24
- 3
modules/xmpp/JingleSessionPC.js 파일 보기

@@ -24,6 +24,8 @@ const IQ_TIMEOUT = 10000;
24 24
 
25 25
 export default class JingleSessionPC extends JingleSession {
26 26
 
27
+    /* eslint-disable max-params */
28
+
27 29
     /**
28 30
      * Creates new <tt>JingleSessionPC</tt>
29 31
      * @param {string} sid the Jingle Session ID - random string which
@@ -48,8 +50,14 @@ export default class JingleSessionPC extends JingleSession {
48 50
      *
49 51
      * @implements {SignalingLayer}
50 52
      */
51
-    constructor(sid, me, peerjid, connection,
52
-                mediaConstraints, iceConfig, options) {
53
+    constructor(
54
+            sid,
55
+            me,
56
+            peerjid,
57
+            connection,
58
+            mediaConstraints,
59
+            iceConfig,
60
+            options) {
53 61
         super(sid, me, peerjid, connection, mediaConstraints, iceConfig);
54 62
 
55 63
         this.lasticecandidate = false;
@@ -98,6 +106,8 @@ export default class JingleSessionPC extends JingleSession {
98 106
             = async.queue(this._processQueueTasks.bind(this), 1);
99 107
     }
100 108
 
109
+    /* eslint-enable max-params */
110
+
101 111
     doInitialize() {
102 112
         this.lasticecandidate = false;
103 113
 
@@ -623,6 +633,8 @@ export default class JingleSessionPC extends JingleSession {
623 633
             IQ_TIMEOUT);
624 634
     }
625 635
 
636
+    /* eslint-disable max-params */
637
+
626 638
     /**
627 639
      * @inheritDoc
628 640
      */
@@ -658,6 +670,8 @@ export default class JingleSessionPC extends JingleSession {
658 670
         this.connection.jingle.terminate(this.sid);
659 671
     }
660 672
 
673
+    /* eslint-enable max-params */
674
+
661 675
     onTerminated(reasonCondition, reasonText) {
662 676
         this.state = 'ended';
663 677
 
@@ -1147,6 +1161,8 @@ export default class JingleSessionPC extends JingleSession {
1147 1161
         return removeSsrcInfo;
1148 1162
     }
1149 1163
 
1164
+    /* eslint-disable max-params */
1165
+
1150 1166
     /**
1151 1167
      * Adds stream.
1152 1168
      * @param stream new stream that will be added.
@@ -1166,7 +1182,6 @@ export default class JingleSessionPC extends JingleSession {
1166 1182
      *  the 'doReplaceStream' task or the 'doAddStream' task (for example)
1167 1183
      */
1168 1184
     addStream(stream, callback, errorCallback, ssrcInfo, dontModifySources) {
1169
-
1170 1185
         const workFunction = finishedCallback => {
1171 1186
             if (!this.peerconnection) {
1172 1187
                 finishedCallback(
@@ -1212,6 +1227,8 @@ export default class JingleSessionPC extends JingleSession {
1212 1227
             });
1213 1228
     }
1214 1229
 
1230
+    /* eslint-enable max-params */
1231
+
1215 1232
     /**
1216 1233
      * Generate ssrc info object for a stream with the following properties:
1217 1234
      * - ssrcs - Array of the ssrcs associated with the stream.
@@ -1291,6 +1308,8 @@ export default class JingleSessionPC extends JingleSession {
1291 1308
         }
1292 1309
     }
1293 1310
 
1311
+    /* eslint-disable max-params */
1312
+
1294 1313
     /**
1295 1314
      * Remove streams.
1296 1315
      * @param stream stream that will be removed.
@@ -1339,6 +1358,8 @@ export default class JingleSessionPC extends JingleSession {
1339 1358
             });
1340 1359
     }
1341 1360
 
1361
+    /* eslint-enable max-params */
1362
+
1342 1363
     /**
1343 1364
      * Figures out added/removed ssrcs and send update IQs.
1344 1365
      * @param oldSDP SDP object for old description.

+ 7
- 3
modules/xmpp/moderator.js 파일 보기

@@ -11,7 +11,6 @@ import Settings from '../settings/Settings';
11 11
 function createExpBackoffTimer(step) {
12 12
     let count = 1;
13 13
 
14
-
15 14
     return function(reset) {
16 15
         // Reset call
17 16
         if (reset) {
@@ -29,6 +28,8 @@ function createExpBackoffTimer(step) {
29 28
     };
30 29
 }
31 30
 
31
+/* eslint-disable max-params */
32
+
32 33
 function Moderator(roomName, xmpp, emitter, options) {
33 34
     this.roomName = roomName;
34 35
     this.xmppService = xmpp;
@@ -42,8 +43,9 @@ function Moderator(roomName, xmpp, emitter, options) {
42 43
     // Sip gateway can be enabled by configuring Jigasi host in config.js or
43 44
     // it will be enabled automatically if focus detects the component through
44 45
     // service discovery.
45
-    this.sipGatewayEnabled = this.options.connection.hosts
46
-        && this.options.connection.hosts.call_control !== undefined;
46
+    this.sipGatewayEnabled
47
+        = this.options.connection.hosts
48
+            && this.options.connection.hosts.call_control !== undefined;
47 49
 
48 50
     this.eventEmitter = emitter;
49 51
 
@@ -74,6 +76,8 @@ function Moderator(roomName, xmpp, emitter, options) {
74 76
     }
75 77
 }
76 78
 
79
+/* eslint-enable max-params */
80
+
77 81
 Moderator.prototype.isExternalAuthEnabled = function() {
78 82
     return this.externalAuthEnabled;
79 83
 };

+ 75
- 47
modules/xmpp/recording.js 파일 보기

@@ -6,8 +6,15 @@ const XMPPEvents = require('../../service/xmpp/XMPPEvents');
6 6
 const JitsiRecorderErrors = require('../../JitsiRecorderErrors');
7 7
 const GlobalOnErrorHandler = require('../util/GlobalOnErrorHandler');
8 8
 
9
-function Recording(type, eventEmitter, connection, focusMucJid, jirecon,
10
-    roomjid) {
9
+/* eslint-disable max-params */
10
+
11
+function Recording(
12
+        type,
13
+        eventEmitter,
14
+        connection,
15
+        focusMucJid,
16
+        jirecon,
17
+        roomjid) {
11 18
     this.eventEmitter = eventEmitter;
12 19
     this.connection = connection;
13 20
     this.state = null;
@@ -30,6 +37,8 @@ function Recording(type, eventEmitter, connection, focusMucJid, jirecon,
30 37
     this.roomjid = roomjid;
31 38
 }
32 39
 
40
+/* eslint-enable max-params */
41
+
33 42
 Recording.types = {
34 43
     COLIBRI: 'colibri',
35 44
     JIRECON: 'jirecon',
@@ -84,42 +93,50 @@ Recording.prototype.handleJibriPresence = function(jibri) {
84 93
     this.eventEmitter.emit(XMPPEvents.RECORDER_STATE_CHANGED, this.state);
85 94
 };
86 95
 
87
-Recording.prototype.setRecordingJibri
88
-    = function(state, callback, errCallback, options = {}) {
96
+/* eslint-disable max-params */
89 97
 
90
-        if (state === this.state) {
91
-            errCallback(JitsiRecorderErrors.INVALID_STATE);
92
-        }
93
-
94
-        // FIXME jibri does not accept IQ without 'url' attribute set ?
95
-        const iq
96
-            = $iq({ to: this.focusMucJid,
97
-                type: 'set' })
98
-                .c('jibri', {
99
-                    'xmlns': 'http://jitsi.org/protocol/jibri',
100
-                    'action': state === Recording.status.ON
101
-                            ? Recording.action.START
102
-                            : Recording.action.STOP,
103
-                    'streamid': options.streamId
104
-                })
105
-                .up();
106
-
107
-        logger.log(`Set jibri recording: ${state}`, iq.nodeTree);
108
-        logger.log(iq.nodeTree);
109
-        this.connection.sendIQ(
110
-        iq,
111
-        result => {
112
-            logger.log('Result', result);
98
+Recording.prototype.setRecordingJibri = function(
99
+        state,
100
+        callback,
101
+        errCallback,
102
+        options = {}) {
103
+    if (state === this.state) {
104
+        errCallback(JitsiRecorderErrors.INVALID_STATE);
105
+    }
113 106
 
114
-            const jibri = $(result).find('jibri');
107
+    // FIXME jibri does not accept IQ without 'url' attribute set ?
108
+    const iq
109
+        = $iq({
110
+            to: this.focusMucJid,
111
+            type: 'set'
112
+        })
113
+            .c('jibri', {
114
+                'xmlns': 'http://jitsi.org/protocol/jibri',
115
+                'action': state === Recording.status.ON
116
+                        ? Recording.action.START
117
+                        : Recording.action.STOP,
118
+                'streamid': options.streamId
119
+            })
120
+            .up();
121
+
122
+    logger.log(`Set jibri recording: ${state}`, iq.nodeTree);
123
+    logger.log(iq.nodeTree);
124
+    this.connection.sendIQ(
125
+    iq,
126
+    result => {
127
+        logger.log('Result', result);
128
+
129
+        const jibri = $(result).find('jibri');
130
+
131
+        callback(jibri.attr('state'), jibri.attr('url'));
132
+    },
133
+    error => {
134
+        logger.log('Failed to start recording, error: ', error);
135
+        errCallback(error);
136
+    });
137
+};
115 138
 
116
-            callback(jibri.attr('state'), jibri.attr('url'));
117
-        },
118
-        error => {
119
-            logger.log('Failed to start recording, error: ', error);
120
-            errCallback(error);
121
-        });
122
-    };
139
+/* eslint-enable max-params */
123 140
 
124 141
 Recording.prototype.setRecordingJirecon
125 142
     = function(state, callback, errCallback) {
@@ -166,23 +183,33 @@ Recording.prototype.setRecordingJirecon
166 183
         });
167 184
     };
168 185
 
186
+/* eslint-disable max-params */
187
+
169 188
 // Sends a COLIBRI message which enables or disables (according to 'state')
170 189
 // the recording on the bridge. Waits for the result IQ and calls 'callback'
171 190
 // with the new recording state, according to the IQ.
172
-Recording.prototype.setRecordingColibri
173
-= function(state, callback, errCallback, options) {
174
-    const elem = $iq({ to: this.focusMucJid,
175
-        type: 'set' });
191
+Recording.prototype.setRecordingColibri = function(
192
+        state,
193
+        callback,
194
+        errCallback,
195
+        options) {
196
+    const elem = $iq({
197
+        to: this.focusMucJid,
198
+        type: 'set'
199
+    });
176 200
 
177 201
     elem.c('conference', {
178 202
         xmlns: 'http://jitsi.org/protocol/colibri'
179 203
     });
180
-    elem.c('recording', { state,
181
-        token: options.token });
204
+    elem.c('recording', {
205
+        state,
206
+        token: options.token
207
+    });
182 208
 
183 209
     const self = this;
184 210
 
185
-    this.connection.sendIQ(elem,
211
+    this.connection.sendIQ(
212
+        elem,
186 213
         result => {
187 214
             logger.log('Set recording "', state, '". Result:', result);
188 215
             const recordingElem = $(result).find('>conference>recording');
@@ -210,17 +237,18 @@ Recording.prototype.setRecordingColibri
210 237
     );
211 238
 };
212 239
 
213
-Recording.prototype.setRecording
214
-= function(state, callback, errCallback, options) {
240
+/* eslint-enable max-params */
241
+
242
+Recording.prototype.setRecording = function(...args) {
215 243
     switch (this.type) {
216 244
     case Recording.types.JIRECON:
217
-        this.setRecordingJirecon(state, callback, errCallback, options);
245
+        this.setRecordingJirecon(...args);
218 246
         break;
219 247
     case Recording.types.COLIBRI:
220
-        this.setRecordingColibri(state, callback, errCallback, options);
248
+        this.setRecordingColibri(...args);
221 249
         break;
222 250
     case Recording.types.JIBRI:
223
-        this.setRecordingJibri(state, callback, errCallback, options);
251
+        this.setRecordingJibri(...args);
224 252
         break;
225 253
     default: {
226 254
         const errmsg = 'Unknown recording type!';

+ 9
- 4
modules/xmpp/strophe.ping.js 파일 보기

@@ -47,23 +47,28 @@ class PingConnectionPlugin extends ConnectionPlugin {
47 47
         Strophe.addNamespace('PING', 'urn:xmpp:ping');
48 48
     }
49 49
 
50
+    /* eslint-disable max-params */
51
+
50 52
     /**
51 53
      * Sends "ping" to given <tt>jid</tt>
52 54
      * @param jid the JID to which ping request will be sent.
53 55
      * @param success callback called on success.
54 56
      * @param error callback called on error.
55 57
      * @param timeout ms how long are we going to wait for the response. On
56
-     *        timeout <tt>error<//t> callback is called with undefined error
57
-     *        argument.
58
+     * timeout <tt>error<//t> callback is called with undefined error argument.
58 59
      */
59 60
     ping(jid, success, error, timeout) {
60
-        const iq = $iq({ type: 'get',
61
-            to: jid });
61
+        const iq = $iq({
62
+            type: 'get',
63
+            to: jid
64
+        });
62 65
 
63 66
         iq.c('ping', { xmlns: Strophe.NS.PING });
64 67
         this.connection.sendIQ(iq, success, error, timeout);
65 68
     }
66 69
 
70
+    /* eslint-enable max-params */
71
+
67 72
     /**
68 73
      * Checks if given <tt>jid</tt> has XEP-0199 ping support.
69 74
      * @param jid the JID to be checked for ping support.

+ 20
- 13
modules/xmpp/strophe.rayo.js 파일 보기

@@ -19,6 +19,8 @@ class RayoConnectionPlugin extends ConnectionPlugin {
19 19
         logger.info('Rayo IQ', iq);
20 20
     }
21 21
 
22
+    /* eslint-disable max-params */
23
+
22 24
     dial(to, from, roomName, roomPass, focusMucJid) {
23 25
         return new Promise((resolve, reject) => {
24 26
             if (!focusMucJid) {
@@ -48,22 +50,27 @@ class RayoConnectionPlugin extends ConnectionPlugin {
48 50
                 }).up();
49 51
             }
50 52
 
51
-            this.connection.sendIQ(req, result => {
52
-                logger.info('Dial result ', result);
53
-
54
-                // eslint-disable-next-line newline-per-chained-call
55
-                const resource = $(result).find('ref').attr('uri');
56
-
57
-                this.callResource = resource.substr('xmpp:'.length);
58
-                logger.info(`Received call resource: ${this.callResource}`);
59
-                resolve();
60
-            }, error => {
61
-                logger.info('Dial error ', error);
62
-                reject(error);
63
-            });
53
+            this.connection.sendIQ(
54
+                req,
55
+                result => {
56
+                    logger.info('Dial result ', result);
57
+
58
+                    // eslint-disable-next-line newline-per-chained-call
59
+                    const resource = $(result).find('ref').attr('uri');
60
+
61
+                    this.callResource = resource.substr('xmpp:'.length);
62
+                    logger.info(`Received call resource: ${this.callResource}`);
63
+                    resolve();
64
+                },
65
+                error => {
66
+                    logger.info('Dial error ', error);
67
+                    reject(error);
68
+                });
64 69
         });
65 70
     }
66 71
 
72
+    /* eslint-enable max-params */
73
+
67 74
     hangup() {
68 75
         return new Promise((resolve, reject) => {
69 76
             if (!this.callResource) {

+ 2
- 2
modules/xmpp/xmpp.js 파일 보기

@@ -324,8 +324,8 @@ export default class XMPP extends Listenable {
324 324
         return (this.connection.logger || {}).log || null;
325 325
     }
326 326
 
327
-    dial(to, from, roomName, roomPass) {
328
-        this.connection.rayo.dial(to, from, roomName, roomPass);
327
+    dial(...args) {
328
+        this.connection.rayo.dial(...args);
329 329
     }
330 330
 
331 331
     setMute(jid, mute) {

Loading…
취소
저장