Skip to content

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.

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

yanas236c4bb37c34
diff --git a/modules/UI/Feedback.js b/modules/UI/Feedback.js
index baf53447c7..c9bbea0d6e 100644
--- a/modules/UI/Feedback.js
+++ b/modules/UI/Feedback.js
@@ -79,7 +79,7 @@ var Feedback = {
init: function () {
// CallStats is the way we send feedback, so we don't have to initialise
// if callstats isn't enabled.
- if (!config.callStatsID || !config.callStatsSecret)
+ if (!callStats.isEnabled())
return;
$("div.feedbackButton").css("display", "block");
@@ -93,9 +93,7 @@ var Feedback = {
* @return true if the feedback functionality is enabled, false otherwise.
*/
isEnabled: function() {
- var isCallStatsEnabled = (config.callStatsID && config.callStatsSecret);
-
- return isCallStatsEnabled;
+ return callStats.isEnabled();
},
/**
* Opens the feedback window.
diff --git a/modules/statistics/CallStats.js b/modules/statistics/CallStats.js
index 3ba54286f7..73327f0aae 100644
--- a/modules/statistics/CallStats.js
+++ b/modules/statistics/CallStats.js
@@ -67,6 +67,16 @@ var CallStats = {
pendingErrors.length = 0;
}
},
+ /**
+ * Returns true if the callstats integration is enabled, otherwise returns
+ * false.
+ *
+ * @returns true if the callstats integration is enabled, otherwise returns
+ * false.
+ */
+ isEnabled: function() {
+ return callStatsIntegrationEnabled;
+ },
pcCallback: function (err, msg) {
if (!callStats) {
return;
@@ -125,7 +135,14 @@ var CallStats = {
callStats.sendUserFeedback(
this.confID, feedbackJSON);
},
-
+ /**
+ * Reports an error to callstats.
+ *
+ * @param type the type of the error, which will be one of the wrtcFuncNames
+ * @param e the error
+ * @param pc the peerconnection
+ * @private
+ */
_reportError: function (type, e, pc) {
if (callStats) {
callStats.reportError(pc, this.confID, type, e);