Commit 3fe2ff23 authored by JC Brand's avatar JC Brand

Fixes #1088

Entity items weren't being fetched from cache.

Apparently this bug only surfaced because with Ejabberd the upload
service is nested one level deeper than with Prosody.
parent 01a88c24
......@@ -346,7 +346,7 @@
'beforeend',
tpl_toolbar_fileupload({'tooltip_upload_file': __('Choose a file to send')}));
}
});
}).catch(_.partial(_converse.log, _, Strophe.LogLevel.FATAL));
},
addSpoilerButton (options) {
......
......@@ -58,6 +58,7 @@
this.items.browserStorage = new Backbone.BrowserStorage[_converse.storage](
b64_sha1(`converse.disco-items-${this.get('jid')}`)
);
this.items.fetch();
},
getIdentity (category, type) {
......@@ -130,7 +131,7 @@
},
onDiscoItems (stanza) {
_.each(stanza.querySelectorAll('query item'), (item) => {
_.each(sizzle(`query[xmlns="${Strophe.NS.DISCO_ITEMS}"] item`, stanza), (item) => {
if (item.getAttribute("node")) {
// XXX: ignore nodes for now.
// See: https://xmpp.org/extensions/xep-0030.html#items-nodes
......@@ -288,7 +289,7 @@
if (_.isNil(entity_jid)) {
throw new TypeError('disco.supports: You need to provide an entity JID');
}
return _converse.api.waitUntil('discoInitialized').then((entity) => {
return _converse.api.waitUntil('discoInitialized').then(() => {
return new Promise((resolve, reject) => {
_converse.api.disco.entities.get(entity_jid, true).then((entity) => {
Promise.all(
......
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