소스 검색

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

+ 18
- 1
modules/statistics/CallStats.js 파일 보기

67
             pendingErrors.length = 0;
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
     pcCallback: function (err, msg) {
80
     pcCallback: function (err, msg) {
71
         if (!callStats) {
81
         if (!callStats) {
72
             return;
82
             return;
125
         callStats.sendUserFeedback(
135
         callStats.sendUserFeedback(
126
             this.confID, feedbackJSON);
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
     _reportError: function (type, e, pc) {
146
     _reportError: function (type, e, pc) {
130
         if (callStats) {
147
         if (callStats) {
131
             callStats.reportError(pc, this.confID, type, e);
148
             callStats.reportError(pc, this.confID, type, e);

Loading…
취소
저장