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.
This commit is contained in:
parent
01a88c24a8
commit
3fe2ff234e
@ -346,7 +346,7 @@
|
|||||||
'beforeend',
|
'beforeend',
|
||||||
tpl_toolbar_fileupload({'tooltip_upload_file': __('Choose a file to send')}));
|
tpl_toolbar_fileupload({'tooltip_upload_file': __('Choose a file to send')}));
|
||||||
}
|
}
|
||||||
});
|
}).catch(_.partial(_converse.log, _, Strophe.LogLevel.FATAL));
|
||||||
},
|
},
|
||||||
|
|
||||||
addSpoilerButton (options) {
|
addSpoilerButton (options) {
|
||||||
|
@ -58,6 +58,7 @@
|
|||||||
this.items.browserStorage = new Backbone.BrowserStorage[_converse.storage](
|
this.items.browserStorage = new Backbone.BrowserStorage[_converse.storage](
|
||||||
b64_sha1(`converse.disco-items-${this.get('jid')}`)
|
b64_sha1(`converse.disco-items-${this.get('jid')}`)
|
||||||
);
|
);
|
||||||
|
this.items.fetch();
|
||||||
},
|
},
|
||||||
|
|
||||||
getIdentity (category, type) {
|
getIdentity (category, type) {
|
||||||
@ -130,7 +131,7 @@
|
|||||||
},
|
},
|
||||||
|
|
||||||
onDiscoItems (stanza) {
|
onDiscoItems (stanza) {
|
||||||
_.each(stanza.querySelectorAll('query item'), (item) => {
|
_.each(sizzle(`query[xmlns="${Strophe.NS.DISCO_ITEMS}"] item`, stanza), (item) => {
|
||||||
if (item.getAttribute("node")) {
|
if (item.getAttribute("node")) {
|
||||||
// XXX: ignore nodes for now.
|
// XXX: ignore nodes for now.
|
||||||
// See: https://xmpp.org/extensions/xep-0030.html#items-nodes
|
// See: https://xmpp.org/extensions/xep-0030.html#items-nodes
|
||||||
@ -288,7 +289,7 @@
|
|||||||
if (_.isNil(entity_jid)) {
|
if (_.isNil(entity_jid)) {
|
||||||
throw new TypeError('disco.supports: You need to provide an 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) => {
|
return new Promise((resolve, reject) => {
|
||||||
_converse.api.disco.entities.get(entity_jid, true).then((entity) => {
|
_converse.api.disco.entities.get(entity_jid, true).then((entity) => {
|
||||||
Promise.all(
|
Promise.all(
|
||||||
|
Loading…
Reference in New Issue
Block a user