Commit eda7e138 authored by Jean-Baptiste Pasquier's avatar Jean-Baptiste Pasquier

fix: store @0.9

parent db128d00
Pipeline #5675 passed with stage
in 28 seconds
......@@ -61,21 +61,23 @@ export const SibChat = {
async populate() {
if(typeof converse_sib !== 'undefined') {
await converse_sib.loaded_deferred;
if (this.resource.jabberRoom) {
this.jid = this.resource['foaf:jabberID'];
if (await this.resource.jabberRoom) {
this.jid = (await this.resource['foaf:jabberID']).toString();
} else {
await store.initGraph(this.resource['@id'], this.context);
this.jid = (await store.get(this.resource['@id'])['chatProfile.jabberID']).toString();
await store.initGraph(this.resource['@id'], {"jabberID": "foaf:jabberID"});
this.jid = (await (store.get(this.resource['@id'])['chatProfile.jabberID'])).toString();
}
await converse_sib.connected_deferred
converse_sib.service.plugins.sibChat.changeChat(
this.jid,
this.resource.jabberRoom,
await this.resource.jabberRoom,
this.element.shadowRoot,
);
window.dispatchEvent(new CustomEvent('read', {
detail: {
resource: this.resource
resource: {
"@id": this.resource
}
}
}));
} // Else, not logged in, on chat change
......@@ -153,16 +155,16 @@ export const SibChat = {
});
let user = await document.querySelector('sib-auth').getUser();
await store.initGraph(user['@id'], this.context);
user = store.get(user['@id']);
const jabberID = (await user['chatProfile.jabberID']).toString();
await store.initGraph(user['@id'], {"jabberID": "foaf:jabberID"});
const jabberID = (await (store.get(user['@id'])['chatProfile.jabberID'])).toString();
if(this.resource) {
if (this.resource.jabberRoom) {
this.jid = this.resource['foaf:jabberID'];
if (await this.resource.jabberRoom) {
this.jid = (await this.resource['foaf:jabberID']).toString();
} else {
await store.initGraph(this.resource['@id'], this.context);
this.jid = (await store.get(this.resource['@id'])['chatProfile.jabberID']).toString();
await store.initGraph(this.resource['@id'], {"jabberID": "foaf:jabberID"});
this.jid = (await (store.get(this.resource['@id'])['chatProfile.jabberID'])).toString();
}
} else {
this.jid = jabberID;
......
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