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"; ...@@ -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'; 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'); 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 { class Deferred {
constructor() { constructor() {
...@@ -64,8 +65,8 @@ export const SibChat = { ...@@ -64,8 +65,8 @@ export const SibChat = {
if (await this.resource.jabberRoom) { if (await this.resource.jabberRoom) {
this.jid = (await this.resource['foaf:jabberID']).toString(); this.jid = (await this.resource['foaf:jabberID']).toString();
} else { } 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(); this.jid = await (store.get(this.resource['@id'])['chatProfile.jabberID']);
} }
await converse_sib.connected_deferred await converse_sib.connected_deferred
converse_sib.service.plugins.sibChat.changeChat( converse_sib.service.plugins.sibChat.changeChat(
...@@ -174,15 +175,14 @@ export const SibChat = { ...@@ -174,15 +175,14 @@ export const SibChat = {
}); });
let user = await document.querySelector('sib-auth').getUser(); let user = await document.querySelector('sib-auth').getUser();
await store.initGraph(user['@id'], {"jabberID": "foaf:jabberID"}); await store.initGraph(user['@id'], jabberIDContext);
const jabberID = (await (store.get(user['@id'])['chatProfile.jabberID'])).toString(); const jabberID = await (store.get(user['@id'])['chatProfile.jabberID']);
if(this.resource) { if(this.resource) {
if (await this.resource.jabberRoom) { if (await this.resource.jabberRoom) {
this.jid = (await this.resource['foaf:jabberID']).toString(); this.jid = (await this.resource['foaf:jabberID']).toString();
} else { } 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(); this.jid = (await (store.get(this.resource['@id'])['chatProfile.jabberID'])).toString();
} }
} else { } 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