Commit 99953636 authored by JC Brand's avatar JC Brand

Fixes #1014 Don't show IRC gateway as MUC prefill

parent 353bbef0
......@@ -68123,9 +68123,9 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
/* Send an IQ stanza to the server asking for all groupchats
*/
_converse.connection.sendIQ($iq({
to: this.model.get('muc_domain'),
from: _converse.connection.jid,
type: "get"
'to': this.model.get('muc_domain'),
'from': _converse.connection.jid,
'type': "get"
}).c("query", {
xmlns: Strophe.NS.DISCO_ITEMS
}), this.onRoomsFound.bind(this), this.informNoRoomsFound.bind(this), 5000);
......@@ -68140,7 +68140,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
setDomain(ev) {
this.model.save({
muc_domain: ev.target.value
'muc_domain': ev.target.value
});
},
......@@ -68175,8 +68175,7 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
parseRoomDataFromEvent(form) {
const data = new FormData(form);
const jid = data.get('chatroom');
const server = Strophe.getDomainFromJid(jid);
this.model.save('muc_domain', server);
this.model.save('muc_domain', Strophe.getDomainFromJid(jid));
return {
'jid': jid,
'nick': data.get('nickname')
......@@ -69758,9 +69757,17 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
* set the MUC domain in the "Add groupchat" modal.
*/
function featureAdded(feature) {
if (feature.get('var') === Strophe.NS.MUC && f.includes('conference', feature.entity.identities.pluck('category'))) {
if (!feature) {
return;
}
if (feature.get('var') === Strophe.NS.MUC) {
feature.getIdentity('conference', 'text').then(identity => {
if (identity) {
setMUCDomain(feature.get('from'), controlboxview);
}
});
}
}
_converse.api.waitUntil('discoInitialized').then(() => {
......@@ -69768,15 +69775,9 @@ var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_
// initialized. We're only interested in MUC
_converse.disco_entities.each(entity => {
const feature = entity.features.findWhere({
_converse.disco_entities.each(entity => featureAdded(entity.features.findWhere({
'var': Strophe.NS.MUC
});
if (feature) {
featureAdded(feature);
}
});
})));
}).catch(_.partial(_converse.log, _, Strophe.LogLevel.ERROR));
}
......@@ -399,9 +399,9 @@
*/
_converse.connection.sendIQ(
$iq({
to: this.model.get('muc_domain'),
from: _converse.connection.jid,
type: "get"
'to': this.model.get('muc_domain'),
'from': _converse.connection.jid,
'type': "get"
}).c("query", {xmlns: Strophe.NS.DISCO_ITEMS}),
this.onRoomsFound.bind(this),
this.informNoRoomsFound.bind(this),
......@@ -417,7 +417,7 @@
},
setDomain (ev) {
this.model.save({muc_domain: ev.target.value});
this.model.save({'muc_domain': ev.target.value});
},
setNick (ev) {
......@@ -451,8 +451,7 @@
parseRoomDataFromEvent (form) {
const data = new FormData(form);
const jid = data.get('chatroom');
const server = Strophe.getDomainFromJid(jid);
this.model.save('muc_domain', server);
this.model.save('muc_domain', Strophe.getDomainFromJid(jid));
return {
'jid': jid,
'nick': data.get('nickname')
......@@ -1954,22 +1953,20 @@
* set the MUC domain in the "Add groupchat" modal.
*/
function featureAdded (feature) {
if (feature.get('var') === Strophe.NS.MUC &&
f.includes('conference', feature.entity.identities.pluck('category'))) {
if (!feature) { return; }
if (feature.get('var') === Strophe.NS.MUC) {
feature.getIdentity('conference', 'text').then(identity => {
if (identity) {
setMUCDomain(feature.get('from'), controlboxview);
}
});
}
}
_converse.api.waitUntil('discoInitialized').then(() => {
_converse.api.listen.on('serviceDiscovered', featureAdded);
// Features could have been added before the controlbox was
// initialized. We're only interested in MUC
_converse.disco_entities.each((entity) => {
const feature = entity.features.findWhere({'var': Strophe.NS.MUC });
if (feature) {
featureAdded(feature)
}
});
_converse.disco_entities.each(entity => featureAdded(entity.features.findWhere({'var': Strophe.NS.MUC })));
}).catch(_.partial(_converse.log, _, Strophe.LogLevel.ERROR));
}
......
......@@ -66,7 +66,7 @@
return;
}
_converse.api.disco.getIdentity('pubsub', 'push', push_app_server.jid)
.then((identity) => {
.then(identity => {
if (!identity) {
return _converse.log(
`Not enabling push the service "${push_app_server.jid}", it doesn't have the right disco identtiy.`,
......
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