diff --git a/app/js/lib/config.js b/app/js/lib/config.js index 93bb1001..bf0f6fbe 100644 --- a/app/js/lib/config.js +++ b/app/js/lib/config.js @@ -27,6 +27,7 @@ Config.App = { Config.Modes = { test: location.search.indexOf('test=1') > 0, debug: location.search.indexOf('debug=1') > 0, + ssl: location.search.indexOf('ssl=1') > 0 || location.protocol == 'https:', packed: location.protocol == 'app:' || location.protocol == 'chrome-extension:', ios_standalone: window.navigator.standalone && navigator.userAgent.match(/iOS|iPhone|iPad/), chrome_packed: window.chrome && chrome.app && chrome.app.window && true || false diff --git a/app/js/lib/mtproto.js b/app/js/lib/mtproto.js index ebcda8f3..d55b817f 100644 --- a/app/js/lib/mtproto.js +++ b/app/js/lib/mtproto.js @@ -9,7 +9,7 @@ angular.module('izhukov.mtproto', ['izhukov.utils']) .factory('MtpDcConfigurator', function () { var dcOptions = Config.Modes.test - ? (location.protocol == 'https:' + ? (Config.Modes.ssl ? [ {id: 1, url: 'https://pluto.web.telegram.org/apiw_test1'}, {id: 2, url: 'https://venus.web.telegram.org/apiw_test1'}, @@ -20,7 +20,7 @@ angular.module('izhukov.mtproto', ['izhukov.utils']) {id: 2, url: 'http://149.154.167.40/apiw1'}, {id: 3, url: 'http://174.140.142.5/apiw1'} ]) - : (location.protocol == 'https:' + : (Config.Modes.ssl ? [ {id: 1, url: 'https://pluto.web.telegram.org/apiw1'}, {id: 2, url: 'https://venus.web.telegram.org/apiw1'},