From 032db0ddef59dfa82780df342a731812bb7dea3c Mon Sep 17 00:00:00 2001
From: Jean-Baptiste Pasquier <contact@jbpasquier.eu>
Date: Wed, 9 Dec 2020 12:20:47 +0100
Subject: [PATCH] minor: contact implementation

---
 src/solid-xmpp-chat.js | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/src/solid-xmpp-chat.js b/src/solid-xmpp-chat.js
index 1712a97..c9c3730 100644
--- a/src/solid-xmpp-chat.js
+++ b/src/solid-xmpp-chat.js
@@ -73,6 +73,13 @@ export const SolidXMPPChat = {
         this.jid = await this.resource['jabberID'];
       } else {
         this.jid = await this.resource['chatProfile.jabberID'];
+        const user = await document.querySelector('sib-auth').getUser();
+        const userProfile = await store.getData(user['@id'], this.context);
+        const contactsURL = await userProfile['contacts.@id'];
+        store.post({
+          "contact": this.resource['@id'],
+          "@context": this.context
+        }, contactsURL);
       }
       await converse_sib.connected_deferred
       converse_sib.service.plugins.sibChat.changeChat(
-- 
GitLab