Procházet zdrojové kódy

Remove unnecessary checks

tags/v0.0.2
Lyubomir Marinov před 9 roky
rodič
revize
721fa9c523
1 změnil soubory, kde provedl 17 přidání a 19 odebrání
  1. 17
    19
      modules/statistics/statistics.js

+ 17
- 19
modules/statistics/statistics.js Zobrazit soubor

@@ -170,7 +170,7 @@ Statistics.prototype.isCallstatsEnabled = function () {
170 170
  * @param {RTCPeerConnection} pc connection on which failure occured.
171 171
  */
172 172
 Statistics.prototype.sendIceConnectionFailedEvent = function (pc) {
173
-    if(this.callStatsIntegrationEnabled && this.callstats)
173
+    if(this.callstats)
174 174
         this.callstats.sendIceConnectionFailedEvent(pc, this.callstats);
175 175
 };
176 176
 
@@ -180,7 +180,7 @@ Statistics.prototype.sendIceConnectionFailedEvent = function (pc) {
180 180
  * @param type {String} "audio"/"video"
181 181
  */
182 182
 Statistics.prototype.sendMuteEvent = function (muted, type) {
183
-    if(this.callStatsIntegrationEnabled)
183
+    if(this.callstats)
184 184
         CallStats.sendMuteEvent(muted, type, this.callstats);
185 185
 };
186 186
 
@@ -190,7 +190,7 @@ Statistics.prototype.sendMuteEvent = function (muted, type) {
190 190
  * false for not stopping
191 191
  */
192 192
 Statistics.prototype.sendScreenSharingEvent = function (start) {
193
-    if(this.callStatsIntegrationEnabled)
193
+    if(this.callstats)
194 194
         CallStats.sendScreenSharingEvent(start, this.callstats);
195 195
 };
196 196
 
@@ -199,7 +199,7 @@ Statistics.prototype.sendScreenSharingEvent = function (start) {
199 199
  * conference.
200 200
  */
201 201
 Statistics.prototype.sendDominantSpeakerEvent = function () {
202
-    if(this.callStatsIntegrationEnabled)
202
+    if(this.callstats)
203 203
         CallStats.sendDominantSpeakerEvent(this.callstats);
204 204
 };
205 205
 
@@ -216,7 +216,7 @@ Statistics.prototype.sendDominantSpeakerEvent = function () {
216 216
  */
217 217
 Statistics.prototype.associateStreamWithVideoTag =
218 218
 function (ssrc, isLocal, usageLabel, containerId) {
219
-    if(this.callStatsIntegrationEnabled && this.callstats) {
219
+    if(this.callstats) {
220 220
         this.callstats.associateStreamWithVideoTag(
221 221
             ssrc, isLocal, usageLabel, containerId);
222 222
     }
@@ -228,7 +228,7 @@ function (ssrc, isLocal, usageLabel, containerId) {
228 228
  * @param {Error} e error to send
229 229
  */
230 230
 Statistics.prototype.sendGetUserMediaFailed = function (e) {
231
-    if(this.callStatsIntegrationEnabled)
231
+    if(this.callstats)
232 232
         CallStats.sendGetUserMediaFailed(e, this.callstats);
233 233
 };
234 234
 
@@ -248,7 +248,7 @@ Statistics.sendGetUserMediaFailed = function (e) {
248 248
  * @param {RTCPeerConnection} pc connection on which failure occured.
249 249
  */
250 250
 Statistics.prototype.sendCreateOfferFailed = function (e, pc) {
251
-    if(this.callStatsIntegrationEnabled)
251
+    if(this.callstats)
252 252
         CallStats.sendCreateOfferFailed(e, pc, this.callstats);
253 253
 };
254 254
 
@@ -259,7 +259,7 @@ Statistics.prototype.sendCreateOfferFailed = function (e, pc) {
259 259
  * @param {RTCPeerConnection} pc connection on which failure occured.
260 260
  */
261 261
 Statistics.prototype.sendCreateAnswerFailed = function (e, pc) {
262
-    if(this.callStatsIntegrationEnabled)
262
+    if(this.callstats)
263 263
         CallStats.sendCreateAnswerFailed(e, pc, this.callstats);
264 264
 };
265 265
 
@@ -270,7 +270,7 @@ Statistics.prototype.sendCreateAnswerFailed = function (e, pc) {
270 270
  * @param {RTCPeerConnection} pc connection on which failure occured.
271 271
  */
272 272
 Statistics.prototype.sendSetLocalDescFailed = function (e, pc) {
273
-    if(this.callStatsIntegrationEnabled)
273
+    if(this.callstats)
274 274
         CallStats.sendSetLocalDescFailed(e, pc, this.callstats);
275 275
 };
276 276
 
@@ -281,7 +281,7 @@ Statistics.prototype.sendSetLocalDescFailed = function (e, pc) {
281 281
  * @param {RTCPeerConnection} pc connection on which failure occured.
282 282
  */
283 283
 Statistics.prototype.sendSetRemoteDescFailed = function (e, pc) {
284
-    if(this.callStatsIntegrationEnabled)
284
+    if(this.callstats)
285 285
         CallStats.sendSetRemoteDescFailed(e, pc, this.callstats);
286 286
 };
287 287
 
@@ -292,7 +292,7 @@ Statistics.prototype.sendSetRemoteDescFailed = function (e, pc) {
292 292
  * @param {RTCPeerConnection} pc connection on which failure occured.
293 293
  */
294 294
 Statistics.prototype.sendAddIceCandidateFailed = function (e, pc) {
295
-    if(this.callStatsIntegrationEnabled)
295
+    if(this.callstats)
296 296
         CallStats.sendAddIceCandidateFailed(e, pc, this.callstats);
297 297
 };
298 298
 
@@ -303,7 +303,7 @@ Statistics.prototype.sendAddIceCandidateFailed = function (e, pc) {
303 303
  * @param {RTCPeerConnection} pc connection on which failure occured.
304 304
  */
305 305
 Statistics.prototype.sendUnhandledError = function (e) {
306
-    if(this.callStatsIntegrationEnabled)
306
+    if(this.callstats)
307 307
         CallStats.sendUnhandledError(e, this.callstats);
308 308
 };
309 309
 
@@ -319,14 +319,12 @@ Statistics.sendUnhandledError = function (e) {
319 319
 /**
320 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 330
 Statistics.LOCAL_JID = require("../../service/statistics/constants").LOCAL_JID;

Načítá se…
Zrušit
Uložit