Преглед изворни кода

Adds a method in callstats in order to check if it's enabled.

j8
yanas пре 10 година
родитељ
комит
236c4bb37c
2 измењених фајлова са 20 додато и 5 уклоњено
  1. 2
    4
      modules/UI/Feedback.js
  2. 18
    1
      modules/statistics/CallStats.js

+ 2
- 4
modules/UI/Feedback.js Прегледај датотеку

@@ -79,7 +79,7 @@ var Feedback = {
79 79
     init: function () {
80 80
         // CallStats is the way we send feedback, so we don't have to initialise
81 81
         // if callstats isn't enabled.
82
-        if (!config.callStatsID || !config.callStatsSecret)
82
+        if (!callStats.isEnabled())
83 83
             return;
84 84
 
85 85
         $("div.feedbackButton").css("display", "block");
@@ -93,9 +93,7 @@ var Feedback = {
93 93
      * @return true if the feedback functionality is enabled, false otherwise.
94 94
      */
95 95
     isEnabled: function() {
96
-        var isCallStatsEnabled = (config.callStatsID && config.callStatsSecret);
97
-
98
-        return isCallStatsEnabled;
96
+        return callStats.isEnabled();
99 97
     },
100 98
     /**
101 99
      * Opens the feedback window.

+ 18
- 1
modules/statistics/CallStats.js Прегледај датотеку

@@ -67,6 +67,16 @@ var CallStats = {
67 67
             pendingErrors.length = 0;
68 68
         }
69 69
     },
70
+    /**
71
+     * Returns true if the callstats integration is enabled, otherwise returns
72
+     * false.
73
+     *
74
+     * @returns true if the callstats integration is enabled, otherwise returns
75
+     * false.
76
+     */
77
+    isEnabled: function() {
78
+        return callStatsIntegrationEnabled;
79
+    },
70 80
     pcCallback: function (err, msg) {
71 81
         if (!callStats) {
72 82
             return;
@@ -125,7 +135,14 @@ var CallStats = {
125 135
         callStats.sendUserFeedback(
126 136
             this.confID, feedbackJSON);
127 137
     },
128
-
138
+    /**
139
+     * Reports an error to callstats.
140
+     *
141
+     * @param type the type of the error, which will be one of the wrtcFuncNames
142
+     * @param e the error
143
+     * @param pc the peerconnection
144
+     * @private
145
+     */
129 146
     _reportError: function (type, e, pc) {
130 147
         if (callStats) {
131 148
             callStats.reportError(pc, this.confID, type, e);

Loading…
Откажи
Сачувај