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