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

Merge branch 'bugfix/add-context-jabberID' into 'master'

bugfix: add context for jabberID

See merge request !21
parents d03a33f1 2110afae
Pipeline #6405 passed with stage
in 28 seconds
......@@ -5,6 +5,7 @@ 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() {
......@@ -64,8 +65,8 @@ export const SibChat = {
if (await this.resource.jabberRoom) {
this.jid = (await this.resource['foaf:jabberID']).toString();
} else {
await store.initGraph(this.resource['@id'], {"jabberID": "foaf:jabberID"});
this.jid = (await (store.get(this.resource['@id'])['chatProfile.jabberID'])).toString();
await store.initGraph(this.resource['@id'], jabberIDContext);
this.jid = await (store.get(this.resource['@id'])['chatProfile.jabberID']);
}
await converse_sib.connected_deferred
converse_sib.service.plugins.sibChat.changeChat(
......@@ -174,15 +175,14 @@ export const SibChat = {
});
let user = await document.querySelector('sib-auth').getUser();
await store.initGraph(user['@id'], {"jabberID": "foaf:jabberID"});
const jabberID = (await (store.get(user['@id'])['chatProfile.jabberID'])).toString();
await store.initGraph(user['@id'], jabberIDContext);
const jabberID = await (store.get(user['@id'])['chatProfile.jabberID']);
if(this.resource) {
if (await this.resource.jabberRoom) {
this.jid = (await this.resource['foaf:jabberID']).toString();
} else {
await store.initGraph(this.resource['@id'], {"jabberID": "foaf:jabberID"});
await store.initGraph(this.resource['@id'], jabberIDContext);
this.jid = (await (store.get(this.resource['@id'])['chatProfile.jabberID'])).toString();
}
} 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