extract auth domain to settings

This commit is contained in:
Casey Watson 2015-07-22 16:15:20 -06:00 committed by Mike Girard
parent cfaa233542
commit 570444dab8
3 changed files with 12 additions and 2 deletions

2
app.js
View File

@ -38,7 +38,7 @@ function init() {
APP.desktopsharing.init();
APP.RTC.start();
APP.xmpp.start();
APP.xmpp.start(APP.settings.getJid(), null);
APP.statistics.start();
APP.connectionquality.init();
APP.keyboardshortcut.init();

View File

@ -95,7 +95,17 @@ var Settings = {
setLanguage: function (lang) {
language = lang;
window.localStorage.language = lang;
},
getJid: function() {
var configDomain = config.hosts.anonymousdomain || config.hosts.domain;
// Force authenticated domain if room is appended with '?login=true'
if (config.hosts.anonymousdomain &&
window.location.search.indexOf("login=true") !== -1) {
configDomain = config.hosts.domain;
}
var jid = configDomain || window.location.hostname;
}
};
module.exports = Settings;

View File

@ -295,7 +295,7 @@ var XMPP = {
* @type {boolean}
*/
forceMuted: false,
start: function () {
start: function (jid, password) {
setupEvents();
initStrophePlugins();
registerListeners();