-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adding Room type with Converse.js replacing jitsi #385
Conversation
This looks really good! I'll check it out locally and play around with it. @morganecf could you take a look as well? |
With this is it possible to control chat colors from the theme? |
Also this is pretty minor, but the rooms don't seem to be listed in the chat server (as in, from the CLI client). I wonder if there's a setting that controls that in the client. There should be some way to make them public/listed/whatever |
Timeouts aside, I wonder if it's possible to hook room leave/window close/other things to explicitly have users leave rooms |
Also do you have any idea what the "hidden message" thing is supposed to do? |
Some responses: With this is it possible to control chat colors from the theme? I'm currently using the $background-color variable to set the borders/icons, but if we want to change other colors we'll need to identify which areas on the screen and which SASS variables to use. I triggered this somehow No clue how you did that or what it even means. Also it seems users aren't cleaned up. Is there a timeout we can control? It seems that Prosody requires that each room has an "owner". It assigns that role to the first user to join the room. If the "owner" leaves the room then Prosody generates a fake "owner": [email protected]. I have no idea how to deal with that. Also this is pretty minor, but the rooms don't seem to be listed in the chat server (as in, from the CLI client). Sorry, no clue on my part. Timeouts aside, I wonder if it's possible to hook room leave/window close/other things to explicitly have users leave rooms I should be able to do that by listening to the onBeforeUnload event (actually, looks like react-beforeunload is a dep so I can use that). Also do you have any idea what the "hidden message" thing is supposed to do? I'm not sure what "hidden message" are you talking about. BTW so this is what happens when you join with the same name: As far as the multiple nicks: since we don't force unique aliases I can see how having 10 Omens in a chat might get confusing. Allowing the users to alter their name for a given chat seems like a good idea to me. FYI: this is being enforced by Converse/Prosody; not me. |
I've added the beforeUnload listener to clean out the user. |
I see some settings here that may be relevant to things i mentioned: https://prosody.im/doc/modules/mod_muc I will try playing around on the backend! |
So, I see that the "owner" is treated as if it is offline. In fact, when I have multiple users in the room and and one leaves (logs out), they still show as offline. I came across some initialization settings for the UI:
These settings do prevent the standard offline members from showing in the list, however, the "owner" still shows. If I could hide that I would feel better. I'll look into it some more this evening. |
I think we might be able to disable the requirement for owners sticking around. I'm specifically looking at that "persist" option in the docs I linked |
Thanks for this @rene-grigory! I'll take a look tomorrow :) |
okay this is basically what i expected. weird that it doesn't seem to do that in my env. i wonder what's broken |
I went to their site and opened a demo and I see the same error in the console that @hndrewaall reported: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I played around with it for a bit and it looks awesome!
I was wondering whether we could control the user's converse chat profile picture, to stay consistent with the rest of the app. I was poking around the code and it seems like we can use the vcard
API to update profile information: https://github.com/conversejs/converse.js/blob/master/src/headless/plugins/vcard.js#L291-L315
It expects a base64 encoded image, so we'd have to download and encode the jitsi user's avatar
, which can be accessed here: https://github.com/morganecf/jitsi-party/blob/master/app/client/jsx/Room.jsx#L82
I ended up getting a proof of concept working with the following, where the image is just a square with a diffusion of red in it:
this._converse.api.listen.on("VCardsInitialized", () => {
this._converse.api.vcard.set(this._converse.bare_jid, {
image: 'iVBORw0KGgoAAAANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU5ErkJggg=='
})
})
This doesn't have to be done in this PR, of course! I figured I'd share since I ended up following the question down a rabbit hole.
EDIT - I realized this may have been unclear so here's a screenshot of what I mean, where the user's default avatar is replaced with a custom one:
app/client/jsx/ChatStreamRoom.jsx
Outdated
plugins = this._converse.pluggable.plugins; | ||
|
||
// add event listener to restucture the chatbox | ||
this._converse.api.listen.on("chatBoxInsertedIntoDOM", () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apparently the chatBoxInsertedIntoDOM
event will be removed in the next major version: https://github.com/conversejs/converse.js/blob/master/CHANGES.md
We could replace it with one of these events: https://github.com/conversejs/converse.js/blob/master/src/plugins/minimize/index.js#L128-L133
import { WebSocketApi } from "./WebAPI.jsx"; | ||
import LocalStorage from "./LocalStorage.jsx"; | ||
import Config from "./Config.jsx"; | ||
import { ChatStreamRoom } from "./ChatStreamRoom.jsx"; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The diff in this file is a little confusing because of what I presume is linting…is there any chance you could commit without the linting? That way our history will be cleaner and reviews will be easier!
app/client/jsx/Room.jsx
Outdated
"emphasis", | ||
"strong", | ||
"delete", | ||
"link", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// CHATSTREAM ROOMS ONLY | ||
// Options related to the bosh service | ||
// Required for chat streaming rooms. | ||
string boshUrl = 17; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be in Room
? Since boshUrl
is always the same, does it need to be part of the room config? Can we make it part of the general config?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good question: I was just following the precedent, but it could certainly be generalized.
@rene-grigory do you think you will be able to get this updated to address morg's feedback this weekend? I would really like to get this merged ASAP, as we will need to start working on the new theme(s) soon (and those will depend on any new theme knobs this generates) |
…e events fire after the chatbox is inserted into the DOM
I think I have addressed all of @morganecf's concerns. |
app/client/jsx/ChatStreamRoom.jsx
Outdated
}); | ||
// title.innerHTML = roomName; | ||
// dd.remove(); | ||
// }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we get rid of the comments?
Thanks for getting to all the feedback! I think it looks good -- I would just remove that commented code and also make a ticket for the avatars linking to my initial comment above, so we can get to that later. |
Oops, good catch. |
@morganecf & @hndrewaall, I've added a number of styling variables for the Chat and emoji popup. I think everything is ready to be merged in. |
This looks really, really good. Thank you @rene-grigory ! I will leave to @morganecf for final approval |
$chat-participants: $fuckyou-turquoise; // the participants sidebar on the right of the chat | ||
$chat-participants-resize: $matte-blue; // color of the participants resize handle | ||
$participants-title: $matte-blue; // the title of the participants list | ||
$participants-name: $matte-blue; // the name of each participant in the list |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for adding these comments, that's very helpful
Looks good to me! |
Issue
Jitsi Rooms using the jitsi-meet for chat only consume a large quantity of processing resources making the rooms unusable at around 75 users.
Solution
Created a room type called CHATSTREAM. CHATSTREAM is very similar to an IFRAME room type except it does not make use of JitsiVideo. Instead, it uses a third party library called Converse.js.
Additional Comments