Commit a09db274 authored by JC Brand's avatar JC Brand

Only set muc domain once connected

parent 9ea018a5
...@@ -148,9 +148,10 @@ ...@@ -148,9 +148,10 @@
onConnected: function () { onConnected: function () {
var converse = this.__super__.converse; var converse = this.__super__.converse;
this.__super__.onConnected.apply(this, arguments); this.__super__.onConnected.apply(this, arguments);
if (!this.model.get('connected')) {
return;
}
if (_.isUndefined(converse.muc_domain)) { if (_.isUndefined(converse.muc_domain)) {
if (this.model.get('connected')) {
converse.features.off('add', this.featureAdded, this); converse.features.off('add', this.featureAdded, this);
converse.features.on('add', this.featureAdded, this); converse.features.on('add', this.featureAdded, this);
// Features could have been added before the controlbox was // Features could have been added before the controlbox was
...@@ -161,7 +162,6 @@ ...@@ -161,7 +162,6 @@
if (feature) { if (feature) {
this.featureAdded(feature); this.featureAdded(feature);
} }
}
} else { } else {
this.setMUCDomain(converse.muc_domain); this.setMUCDomain(converse.muc_domain);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment