Commit 21519109 authored by Clément's avatar Clément

bugfix: wrong jabberID & username

parent d0ba1734
Pipeline #4710 passed with stage
in 28 seconds
......@@ -60,7 +60,7 @@
<h1>Demo of an XMPP chatroom via a web component</h1>
<div class="converse-container">
<sib-chat
data-src="https://test-paris.happy-dev.fr/members/1/"
data-src="https://api.test-paris.happy-dev.fr/projects/3/"
data-authentication="login"
data-auto-login="true"
data-bosh-service-url="https://jabber.happy-dev.fr/http-bind/"
......
......@@ -75,8 +75,9 @@ export const ChatWindow = {
const resource = await store
.get(user)
const jabberID = resource.chatProfile['foaf:jabberID'];
window.converse_sib.changeChat(
jabberID,
(this.resource.jabberID || this.resource.chatProfile.jabberID),
this.resource.jabberRoom,
this.element.shadowRoot,
);
......@@ -91,12 +92,13 @@ export const ChatWindow = {
window.converse_sib = new ConversePlugin();
converse.plugins.add('sib-chat', converse_sib);
const user = await document.querySelector('sib-auth').getUser();
const jabberID = await store
.get(user)
.then(resource => resource.chatProfile['foaf:jabberID']);
let user = await document.querySelector('sib-auth').getUser();
user = await store
.get(user);
const jabberID = user.chatProfile['foaf:jabberID'];
debugger;
const idToken = await document.querySelector('sib-auth').getUserIdToken();
debugger
await converse.initialize({
debug: true,
root: this.element.shadowRoot,
......@@ -116,7 +118,6 @@ export const ChatWindow = {
});
window.converseInitialized.resolve();
},
get extra_context() {
return {
foaf: 'http://xmlns.com/foaf/0.1/',
......
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