diff --git a/www/common/cryptpad-common.js b/www/common/cryptpad-common.js index 0e2b7c62a..61e8b3a71 100644 --- a/www/common/cryptpad-common.js +++ b/www/common/cryptpad-common.js @@ -89,6 +89,7 @@ define([ value: token }, function (obj) { if (obj && obj.error) { return void cb(obj.error); } + Feedback.send('LOGOUT_EVERYWHERE'); cb(); }); }; @@ -118,7 +119,14 @@ define([ }; // Settings common.deleteAccount = function (cb) { - postMessage("DELETE_ACCOUNT", null, cb); + postMessage("DELETE_ACCOUNT", null, function (obj) { + if (obj.state) { + Feedback.send('DELETE_ACCOUNT_AUTOMATIC'); + } else { + Feedback.send('DELETE_ACCOUNT_MANUAL'); + } + cb(obj); + }); }; // Drive common.userObjectCommand = function (data, cb) { @@ -1099,6 +1107,14 @@ define([ return doesSupport; }; + common.isWebRTCSupported = function () { + return navigator.getUserMedia || + navigator.webkitGetUserMedia || + navigator.mozGetUserMedia || + navigator.msGetUserMedia || + window.RTCPeerConnection; + }; + common.ready = (function () { var env = {}; var initialized = false; @@ -1114,6 +1130,10 @@ define([ Feedback.send("NO_PROXIES"); } + if (!common.isWebRTCSupported()) { + Feedback.send("NO_WEBRTC"); + } + var shimPattern = /CRYPTPAD_SHIM/; if (shimPattern.test(Array.isArray.toString())) { Feedback.send("NO_ISARRAY"); diff --git a/www/settings/inner.js b/www/settings/inner.js index 6c4e794a9..7f700f959 100644 --- a/www/settings/inner.js +++ b/www/settings/inner.js @@ -13,6 +13,7 @@ define([ '/customize/application_config.js', '/api/config', '/settings/make-backup.js', + '/common/common-feedback.js', '/bower_components/file-saver/FileSaver.min.js', 'css!/bower_components/bootstrap/dist/css/bootstrap.min.css', @@ -32,7 +33,8 @@ define([ Cred, AppConfig, ApiConfig, - Backup + Backup, + Feedback ) { var saveAs = window.saveAs; @@ -88,6 +90,7 @@ define([ onClick: function () { var urls = common.getMetadataMgr().getPrivateData().accounts; window.open(urls.upgradeURL); + Feedback.send('SUBSCRIPTION_BUTTON'); } } };