Commit 0379d31b authored by Jean-Baptiste Pasquier's avatar Jean-Baptiste Pasquier

fix: context

parent 02876a0c
Pipeline #7348 passed with stage
in 27 seconds
......@@ -5,7 +5,6 @@ import { Sib } from "https://unpkg.com/@startinblox/core@0.9/dist/libs/Sib.js";
import { StoreMixin } from 'https://unpkg.com/@startinblox/core@0.9/dist/mixins/storeMixin.js';
Helpers.importCSS('https://unpkg.com/converse.js@4.2/css/fonts.css');
const jabberIDContext = { "foaf": 'http://xmlns.com/foaf/0.1/', "chatProfile": "http://happy-dev.fr/owl/#chatProfile", "jabberID": "foaf:jabberID" };
class Deferred {
constructor() {
......@@ -39,6 +38,10 @@ export const SibChat = {
},
},
get context() {
return { "foaf": 'http://xmlns.com/foaf/0.1/', "chatProfile": "http://happy-dev.fr/owl/#chatProfile", "jabberID": "foaf:jabberID" };
},
async created() {
const check_identified = await document.querySelector('sib-auth').getUserIdToken();
if(check_identified) {
......@@ -65,7 +68,7 @@ export const SibChat = {
if (await this.resource.jabberRoom) {
this.jid = (await this.resource['foaf:jabberID']);
} else {
await store.initGraph(this.resource['@id'], jabberIDContext);
await store.initGraph(this.resource['@id'], this.context);
this.jid = await (store.get(this.resource['@id'])['chatProfile.jabberID']);
}
await converse_sib.connected_deferred
......@@ -161,14 +164,14 @@ export const SibChat = {
});
let user = await document.querySelector('sib-auth').getUser();
await store.initGraph(user['@id'], jabberIDContext);
await store.initGraph(user['@id'], this.context);
const jabberID = await (store.get(user['@id'])['chatProfile.jabberID']);
if(this.resource) {
if (await this.resource.jabberRoom) {
this.jid = (await this.resource['foaf:jabberID']);
} else {
await store.initGraph(this.resource['@id'], jabberIDContext);
await store.initGraph(this.resource['@id'], this.context);
this.jid = (await (store.get(this.resource['@id'])['chatProfile.jabberID']));
}
} else {
......
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