The component should be able to receive a LDP resource with a data-src attribute. It should then fetch the resource and get the XMPP channel id in a dedicated field of that resource.
Designs
Child items
...
Show closed items
Linked items
0
Link issues together to show that they're related.
Learn more.
It's a semantic web graph. But as far as the component is concerned, it is basically a JS object.
The workflow is: the data-src element is set with an id, the component fetches the related object in the store, it reads a property of the object and displays the corresponding channel.
@sylvain : Yes, I think that it is necessary to show this to @jcbrand, otherwise he won't have the big picture. However, maybe you should implement this part :-)
By Alexandre on 2018-03-28T14:32:34 (imported from GitLab project)
@sylvain : The true answer is : I trust your opinion on this.
The longer version is : you told me about it, it makes sense and I can't propose any better.
It makes the component easy to configure. I am not sure about the LDP layer but it wouldn't cost much to remove it so... I am keen on moving forward with this and in 3 months, we will see if it was the right technical bet or not.
Right now I can say that it is not stupid and I am backing it. I can't propose any better and I like that it makes the chat component very modular and easily configurable
By Alexandre on 2018-03-28T20:23:18 (imported from GitLab project)
2 Then you need to get your component inherit from LDPBase instead of HTMLElement.
3 You then add a populate method where you can access the jabber id through this.resource.jabberID:
id = this.resource.jabberID; //Initialize the channel here}```4 You can test it by just adding `data-src="https://djangoldp.happy-dev.fr/users/1"` as an attribute to the element. There is also https://djangoldp.happy-dev.fr/users/2 for a single user jabberID. Let me know if you want other test values.5 I think we should rename the component to get it inline with this modification. I suggest we call it ldp-chat. *By Sylvain Le Bon on 2018-04-24T16:22:52 (imported from GitLab project)*
The file https://cdn.happy-dev.fr/ldp-display/ldp-base.html seems to be empty when I open it in my editor, and I get the following error chat-window-component.html:30 Uncaught ReferenceError: LDPBase is not defined, are you sure that the import path is correct?
hmmm, when I open it via elinks, it's empty, but when I download it via wget then I get the file and I can see that LDPBase is being defined inside it....
By JC Brand on 2018-05-08T09:58:27 (imported from GitLab project)
Hi @sylvain, I see the jabberID for https://djangoldp.happy-dev.fr/users/1 is set to anonymous@conference.nomnom.im.
However, that JID is for a chatroom, not for a person, so it seems wrong to me. Is the jabberID attribute supposed to refer to a user or a channel?
Currently the chat component is set up so that users log in anonymously, which means we don't have any pre-defined JIDs for them. This is so that we have something to demo, but eventually we'll have to give them pre-defined JIDs and pass their login credentials to the chat component.
By JC Brand on 2018-05-08T10:20:25 (imported from GitLab project)
I notice now that you have jabberID for a channel for user 1 and for a contact for user 2.
The chat component cannot know whether a JID is for a contact for a channel, so we'll have to distinguish between the two in the user data by having to separate attributes, for example roomJID and contactJID, and only one can have a value at any one time as we can have only one chat per component.
By JC Brand on 2018-05-08T10:34:24 (imported from GitLab project)
Basically, the component has to know if the chat is a one-on-one or a group chat.
Isn't it better if we provide one generic jid attribute and add a second attribute like type that could be of value group or private ? Seems a little bit better to me than having an potentially empty attribute. But I am being picky, I got the idea.