Quellcode durchsuchen

Remove unnecessary checks

tags/v0.0.2
Lyubomir Marinov vor 9 Jahren
Ursprung
Commit
721fa9c523
1 geänderte Dateien mit 17 neuen und 19 gelöschten Zeilen
  1. 17
    19
      modules/statistics/statistics.js

+ 17
- 19
modules/statistics/statistics.js Datei anzeigen

170
  * @param {RTCPeerConnection} pc connection on which failure occured.
170
  * @param {RTCPeerConnection} pc connection on which failure occured.
171
  */
171
  */
172
 Statistics.prototype.sendIceConnectionFailedEvent = function (pc) {
172
 Statistics.prototype.sendIceConnectionFailedEvent = function (pc) {
173
-    if(this.callStatsIntegrationEnabled && this.callstats)
173
+    if(this.callstats)
174
         this.callstats.sendIceConnectionFailedEvent(pc, this.callstats);
174
         this.callstats.sendIceConnectionFailedEvent(pc, this.callstats);
175
 };
175
 };
176
 
176
 
180
  * @param type {String} "audio"/"video"
180
  * @param type {String} "audio"/"video"
181
  */
181
  */
182
 Statistics.prototype.sendMuteEvent = function (muted, type) {
182
 Statistics.prototype.sendMuteEvent = function (muted, type) {
183
-    if(this.callStatsIntegrationEnabled)
183
+    if(this.callstats)
184
         CallStats.sendMuteEvent(muted, type, this.callstats);
184
         CallStats.sendMuteEvent(muted, type, this.callstats);
185
 };
185
 };
186
 
186
 
190
  * false for not stopping
190
  * false for not stopping
191
  */
191
  */
192
 Statistics.prototype.sendScreenSharingEvent = function (start) {
192
 Statistics.prototype.sendScreenSharingEvent = function (start) {
193
-    if(this.callStatsIntegrationEnabled)
193
+    if(this.callstats)
194
         CallStats.sendScreenSharingEvent(start, this.callstats);
194
         CallStats.sendScreenSharingEvent(start, this.callstats);
195
 };
195
 };
196
 
196
 
199
  * conference.
199
  * conference.
200
  */
200
  */
201
 Statistics.prototype.sendDominantSpeakerEvent = function () {
201
 Statistics.prototype.sendDominantSpeakerEvent = function () {
202
-    if(this.callStatsIntegrationEnabled)
202
+    if(this.callstats)
203
         CallStats.sendDominantSpeakerEvent(this.callstats);
203
         CallStats.sendDominantSpeakerEvent(this.callstats);
204
 };
204
 };
205
 
205
 
216
  */
216
  */
217
 Statistics.prototype.associateStreamWithVideoTag =
217
 Statistics.prototype.associateStreamWithVideoTag =
218
 function (ssrc, isLocal, usageLabel, containerId) {
218
 function (ssrc, isLocal, usageLabel, containerId) {
219
-    if(this.callStatsIntegrationEnabled && this.callstats) {
219
+    if(this.callstats) {
220
         this.callstats.associateStreamWithVideoTag(
220
         this.callstats.associateStreamWithVideoTag(
221
             ssrc, isLocal, usageLabel, containerId);
221
             ssrc, isLocal, usageLabel, containerId);
222
     }
222
     }
228
  * @param {Error} e error to send
228
  * @param {Error} e error to send
229
  */
229
  */
230
 Statistics.prototype.sendGetUserMediaFailed = function (e) {
230
 Statistics.prototype.sendGetUserMediaFailed = function (e) {
231
-    if(this.callStatsIntegrationEnabled)
231
+    if(this.callstats)
232
         CallStats.sendGetUserMediaFailed(e, this.callstats);
232
         CallStats.sendGetUserMediaFailed(e, this.callstats);
233
 };
233
 };
234
 
234
 
248
  * @param {RTCPeerConnection} pc connection on which failure occured.
248
  * @param {RTCPeerConnection} pc connection on which failure occured.
249
  */
249
  */
250
 Statistics.prototype.sendCreateOfferFailed = function (e, pc) {
250
 Statistics.prototype.sendCreateOfferFailed = function (e, pc) {
251
-    if(this.callStatsIntegrationEnabled)
251
+    if(this.callstats)
252
         CallStats.sendCreateOfferFailed(e, pc, this.callstats);
252
         CallStats.sendCreateOfferFailed(e, pc, this.callstats);
253
 };
253
 };
254
 
254
 
259
  * @param {RTCPeerConnection} pc connection on which failure occured.
259
  * @param {RTCPeerConnection} pc connection on which failure occured.
260
  */
260
  */
261
 Statistics.prototype.sendCreateAnswerFailed = function (e, pc) {
261
 Statistics.prototype.sendCreateAnswerFailed = function (e, pc) {
262
-    if(this.callStatsIntegrationEnabled)
262
+    if(this.callstats)
263
         CallStats.sendCreateAnswerFailed(e, pc, this.callstats);
263
         CallStats.sendCreateAnswerFailed(e, pc, this.callstats);
264
 };
264
 };
265
 
265
 
270
  * @param {RTCPeerConnection} pc connection on which failure occured.
270
  * @param {RTCPeerConnection} pc connection on which failure occured.
271
  */
271
  */
272
 Statistics.prototype.sendSetLocalDescFailed = function (e, pc) {
272
 Statistics.prototype.sendSetLocalDescFailed = function (e, pc) {
273
-    if(this.callStatsIntegrationEnabled)
273
+    if(this.callstats)
274
         CallStats.sendSetLocalDescFailed(e, pc, this.callstats);
274
         CallStats.sendSetLocalDescFailed(e, pc, this.callstats);
275
 };
275
 };
276
 
276
 
281
  * @param {RTCPeerConnection} pc connection on which failure occured.
281
  * @param {RTCPeerConnection} pc connection on which failure occured.
282
  */
282
  */
283
 Statistics.prototype.sendSetRemoteDescFailed = function (e, pc) {
283
 Statistics.prototype.sendSetRemoteDescFailed = function (e, pc) {
284
-    if(this.callStatsIntegrationEnabled)
284
+    if(this.callstats)
285
         CallStats.sendSetRemoteDescFailed(e, pc, this.callstats);
285
         CallStats.sendSetRemoteDescFailed(e, pc, this.callstats);
286
 };
286
 };
287
 
287
 
292
  * @param {RTCPeerConnection} pc connection on which failure occured.
292
  * @param {RTCPeerConnection} pc connection on which failure occured.
293
  */
293
  */
294
 Statistics.prototype.sendAddIceCandidateFailed = function (e, pc) {
294
 Statistics.prototype.sendAddIceCandidateFailed = function (e, pc) {
295
-    if(this.callStatsIntegrationEnabled)
295
+    if(this.callstats)
296
         CallStats.sendAddIceCandidateFailed(e, pc, this.callstats);
296
         CallStats.sendAddIceCandidateFailed(e, pc, this.callstats);
297
 };
297
 };
298
 
298
 
303
  * @param {RTCPeerConnection} pc connection on which failure occured.
303
  * @param {RTCPeerConnection} pc connection on which failure occured.
304
  */
304
  */
305
 Statistics.prototype.sendUnhandledError = function (e) {
305
 Statistics.prototype.sendUnhandledError = function (e) {
306
-    if(this.callStatsIntegrationEnabled)
306
+    if(this.callstats)
307
         CallStats.sendUnhandledError(e, this.callstats);
307
         CallStats.sendUnhandledError(e, this.callstats);
308
 };
308
 };
309
 
309
 
319
 /**
319
 /**
320
  * Sends the given feedback through CallStats.
320
  * Sends the given feedback through CallStats.
321
  *
321
  *
322
- * @param overallFeedback an integer between 1 and 5 indicating the
323
- * user feedback
324
- * @param detailedFeedback detailed feedback from the user. Not yet used
322
+ * @param overall an integer between 1 and 5 indicating the user feedback
323
+ * @param detailed detailed feedback from the user. Not yet used
325
  */
324
  */
326
-Statistics.prototype.sendFeedback =
327
-function(overallFeedback, detailedFeedback){
328
-    if(this.callStatsIntegrationEnabled && this.callstats)
329
-        this.callstats.sendFeedback(overallFeedback, detailedFeedback);
325
+Statistics.prototype.sendFeedback = function(overall, detailed) {
326
+    if(this.callstats)
327
+        this.callstats.sendFeedback(overall, detailed);
330
 };
328
 };
331
 
329
 
332
 Statistics.LOCAL_JID = require("../../service/statistics/constants").LOCAL_JID;
330
 Statistics.LOCAL_JID = require("../../service/statistics/constants").LOCAL_JID;

Laden…
Abbrechen
Speichern