Fix missing disco-items in session storage

This should fix #2925.
This commit is contained in:
Johan Oudinet 2022-07-04 15:58:57 +02:00 committed by JC Brand
parent 5231262bda
commit 760f4f7dd1
2 changed files with 5 additions and 2 deletions

View File

@ -12,6 +12,7 @@
- Update `nick` attribute on ChatRoom when user nickname changes
- Restrict editing of MUC messages to ones with the same XEP-0421 occupant ID
- #2936: Fix documentation about enable_smacks option, which is true by default.
- #2925: Fix missing disco-items in browser storage.
## 9.1.1 (2022-05-05)

View File

@ -142,9 +142,11 @@ const DiscoEntity = Model.extend({
}
const jid = item.getAttribute('jid');
if (this.items.get(jid) === undefined) {
const name = item.getAttribute('name');
const entities = _converse.disco_entities;
const entity = entities.get(jid) || entities.create({ jid, name: item.getAttribute('name') });
this.items.add(entity);
if (!entities.get(jid))
entities.create({ jid, name });
this.items.create({ jid, name });
}
});
},