Skip to content
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

Feat/lobby chat #10847

Merged
merged 2 commits into from
Mar 3, 2022
Merged

Feat/lobby chat #10847

merged 2 commits into from
Mar 3, 2022

Conversation

doganbros
Copy link

Better moderation capabilities in locked down rooms: challenge/response in lobby #9714
Lobby chat support
Knocking participants list updates
Knocking participants conditonal checks to show message button
Handle lobby chat events
Allow messages in mod_muc_lobby_rooms.lua

@jitsi-jenkins
Copy link

Hi, thanks for your contribution!
If you haven't already done so, could you please make sure you sign our CLA (https://jitsi.org/icla for individuals and https://jitsi.org/ccla for corporations)? We would unfortunately be unable to merge your patch unless we have that piece :(.

@doganbros
Copy link
Author

doganbros commented Jan 25, 2022

@gpatel-fr we resolved most of the issues you raised in the previous pull request.

  1. We changed all the occurrences of challenge-response to lobby chat. Also the moderator is anonymous when he is chatting with the knocking participant.
  2. Also we refactored the mod_muc_lobby_rooms.lua's filter_stanza to support only private messages and moderator messages.
  3. The code block you deleted the other time is still necessary because we need to make the attendee aware about the moderator's absence in the UI, even though they get the presence unavailable stanza.
  4. We refactored some of the action names as you suggested.

@damencho
Copy link
Member

Hey @doganbros we deployed it here https://lobby-chat.jitsi.net/ so we can preview the feature ... but there is something wrong, when you click the chat button in the notification or participants pane it does not work ... can you check it out, please.

@mkhstar
Copy link

mkhstar commented Jan 28, 2022

@damencho probably the mod_muc_lobby_rooms.lua module was not updated. Because the messages are filtered

@damencho
Copy link
Member

@damencho probably the mod_muc_lobby_rooms.lua module was not updated. Because the messages are filtered

Good point I will check it tomorrow, I think I restarted prosody... But maybe I missed that, will see.

@damencho
Copy link
Member

@damencho probably the mod_muc_lobby_rooms.lua module was not updated. Because the messages are filtered

Good point I will check it tomorrow, I think I restarted prosody... But maybe I missed that, will see.

Yep, you were right, now it works.

Copy link
Member

@damencho damencho left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lib-jitsi-meet part is merged :) Congrats and thank you!

@@ -158,6 +158,20 @@ function filter_stanza(stanza)
elseif stanza.name == 'iq' and stanza:get_child('query', DISCO_INFO_NS) then
-- allow disco info from the lobby component
return stanza;
elseif stanza.name == 'message' then
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should be checking here whether the message is from moderator or to moderator ...

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @damencho we currently allow private messages and also messages only to a moderator from line 163 to 173. (Or should we implement it differently). I think we are left with checking messages from a moderator

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let me check again, when I was looking at it I had the impression that lobby users can send messages to lobby users privately or via group messages.

Copy link
Member

@damencho damencho Feb 7, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So you allow all messages between lobby participants and group messages to moderators. So I was assuming group chats between participants are possible ... but there are not.

Can you easily check and do it: "messages to and from moderators are only allowed"... ?
It shouldn't be possible to find other participants ids, but just in case the check ^ seems better, I think.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That makes sense, we will check on that

@@ -241,3 +250,149 @@ export function hideLobbyScreen() {
visible: false
};
}

/** ......................................
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you drop the dots :)

{ this._renderStandardButtons() }
</div>
);
}


/** ....................
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Drop and these, thank you.

@damencho
Copy link
Member

damencho commented Feb 7, 2022

An update: I'm still waiting for a confirmation from Product and Design on few things. Design is finalizing the mobile part.
There are few changes probably. Here is what I know.

  1. In the notification move Chat button between Admit and Reject.
    Screenshot 2022-02-07 at 14 43 31

  2. Make lobby chat use a different color than private messages (to be confirmed with the color).

  3. Create overflow menu for Chat and Reject in participants pane.
    Screenshot 2022-02-07 at 14 45 21

  4. Create the chat for the guests to look like a normal group chat.
    Screenshot 2022-02-07 at 14 46 33

I think that's all. And when the design comes back to me, I will post here the link to the designs.
While waiting for the final thing. I think 1. and 3. can be done and now. For 3, the reasoning is too many buttons and those are not used so often and are visually hiding the display name. And there is already a button like that in the participants pane for other operations.
If 4 is not trivial ... we may leave it for the second phase or we can do it after merging this PR.

Thank you again.

@umitdogan1
Copy link

An update: I'm still waiting for a confirmation from Product and Design on few things. Design is finalizing the mobile part. There are few changes probably. Here is what I know.

  1. In the notification move Chat button between Admit and Reject.
    Screenshot 2022-02-07 at 14 43 31
  2. Make lobby chat use a different color than private messages (to be confirmed with the color).
  3. Create overflow menu for Chat and Reject in participants pane.
    Screenshot 2022-02-07 at 14 45 21
  4. Create the chat for the guests to look like a normal group chat.
    Screenshot 2022-02-07 at 14 46 33

I think that's all. And when the design comes back to me, I will post here the link to the designs. While waiting for the final thing. I think 1. and 3. can be done and now. For 3, the reasoning is too many buttons and those are not used so often and are visually hiding the display name. And there is already a button like that in the participants pane for other operations. If 4 is not trivial ... we may leave it for the second phase or we can do it after merging this PR.

Thank you again.

@damencho I see... Will start to work on 1 and 3. Thank you too.

@gpatel-fr
Copy link

Hello

I have not experienced any crash or unconsistent behaviour on my test instance.
I only tested on web, not mobile.

A minor nit is that when there is one moderator and several candidates, the moderator workflow is not optimal.
If the mod sends a message to several persons, (without waiting for a reply of each), ideally it could be possible
to just wait for the answers and grant the entry without having to click again to chat with each person.
Well, the world is not perfect either but one day hopefully it will be :-)

On the code I have noticed this small strangeness in chat/actions.any.js:

  • @param {boolean} removeLobbyChatMessages - The participant to remove

boolean for a participant ID ?? There is something not quite right here.
I think that the comment should be changed to something like

-> should remove messages from chat (works only for accepted users)

  • circa line 145 chat/action.any.js: onLobbyChatInitialized(lobbyChatInititializedInfo...
    spelling problem.
    -> lobbyChatInitializedInfo

  • in lobby/actions.any.js the function name 'updateLobbyParticipantOnModeratorLeave' seems to say that participantId should be a moderator's ID. But that's not the case, as shown in the code:

if (knocking && lobbyMessageRecipient && lobbyMessageRecipient.id === participantId)

this part shows clearly that this function can be called with a non moderator ID.
So IMO the function could be called updateLobbyParticipantOnLeave instead.

(remark)
Note that I have wondered why this is working only for accepted participants, the rejected ones can still see the chat dialog after being left in the wild. That's because the participant is booted out of the lobby before it can be called.
I don't think that's a problem, while it's good that the chat is cleaned for accepted participants (and this works).
What could be considered is that maybe the chat could be cleaned also for the moderator when a user is accepted/rejected.

On the prosody code, there is also a small nit: your code is duplicating a similar part in the
presence handling, however in this part the result is tested:

local lobby_room = lobby_muc_service.get_room_from_jid(lobby_room_jid);
if not lobby_room then
module:log('warn', 'No lobby room found %s', lobby_room_jid);
return stanza;
end

if it makes sense to test the get_room_from_jid function in the presence handling, maybe it would make sense to test it also at this point.

Last - I would like to apologize for my first review, on one minor vocabulary point I was overly harsh and my tone was not appropriate. I can only say I was tired at the time.

Anyway, cheers for the very impressive work !

@damencho
Copy link
Member

damencho commented Feb 8, 2022

@gpatel-fr Thank you for your review and for looking deep into the PR. That is a great help!

@umitdogan1
Copy link

Hello

I have not experienced any crash or unconsistent behaviour on my test instance. I only tested on web, not mobile.

A minor nit is that when there is one moderator and several candidates, the moderator workflow is not optimal. If the mod sends a message to several persons, (without waiting for a reply of each), ideally it could be possible to just wait for the answers and grant the entry without having to click again to chat with each person. Well, the world is not perfect either but one day hopefully it will be :-)

On the code I have noticed this small strangeness in chat/actions.any.js:

  • @param {boolean} removeLobbyChatMessages - The participant to remove

boolean for a participant ID ?? There is something not quite right here. I think that the comment should be changed to something like

-> should remove messages from chat (works only for accepted users)

  • circa line 145 chat/action.any.js: onLobbyChatInitialized(lobbyChatInititializedInfo...
    spelling problem.
    -> lobbyChatInitializedInfo
  • in lobby/actions.any.js the function name 'updateLobbyParticipantOnModeratorLeave' seems to say that participantId should be a moderator's ID. But that's not the case, as shown in the code:

if (knocking && lobbyMessageRecipient && lobbyMessageRecipient.id === participantId)

this part shows clearly that this function can be called with a non moderator ID. So IMO the function could be called updateLobbyParticipantOnLeave instead.

(remark) Note that I have wondered why this is working only for accepted participants, the rejected ones can still see the chat dialog after being left in the wild. That's because the participant is booted out of the lobby before it can be called. I don't think that's a problem, while it's good that the chat is cleaned for accepted participants (and this works). What could be considered is that maybe the chat could be cleaned also for the moderator when a user is accepted/rejected.

On the prosody code, there is also a small nit: your code is duplicating a similar part in the presence handling, however in this part the result is tested:

local lobby_room = lobby_muc_service.get_room_from_jid(lobby_room_jid); if not lobby_room then module:log('warn', 'No lobby room found %s', lobby_room_jid); return stanza; end

if it makes sense to test the get_room_from_jid function in the presence handling, maybe it would make sense to test it also at this point.

Last - I would like to apologize for my first review, on one minor vocabulary point I was overly harsh and my tone was not appropriate. I can only say I was tired at the time.

Anyway, cheers for the very impressive work !

Thank you on be half of the team. Will check your comments...

@umitdogan1
Copy link

umitdogan1 commented Feb 14, 2022

@damencho few quick notes about the updates:
We tried to implement the buttons and overflow to match with the current UI implementation. Tried to be consistent with the current UI as much as possible. We can do this small styling/arrangements later when UI design is finalized on your side.

  1. We did not change the color of "Reject" and left as it is (which is blue).
    image

  2. Overflow menu icon with three dots is blue on the current jitsi-meet but it was gray on your screenshot. We left as it is.

image

  1. Also, changing the order of Reject and Admit in the current jitsi-meet UI would be better. But again we did not change it.

image

@umitdogan1
Copy link

@damencho any update regarding to new UI design?

@damencho
Copy link
Member

Hum, I was waiting for some replay ... Will check it tomorrow and will let you know.

@damencho
Copy link
Member

I think all I mentioned before is the latest state.

So I have these designs:
desktop: https://www.figma.com/file/xE4oxRXxQGJ9u1A56b4Oid/%E2%9C%8A-Challenge%2Fresponse-in-lobby?node-id=0%3A1
mobile: https://www.figma.com/file/xE4oxRXxQGJ9u1A56b4Oid/%E2%9C%8A-Challenge%2Fresponse-in-lobby?node-id=2%3A6400

Yeah do not do anything outside of the feature you are doing to keep it simple.

@umitdogan1
Copy link

I think all I mentioned before is the latest state.

So I have these designs: desktop: https://www.figma.com/file/xE4oxRXxQGJ9u1A56b4Oid/%E2%9C%8A-Challenge%2Fresponse-in-lobby?node-id=0%3A1 mobile: https://www.figma.com/file/xE4oxRXxQGJ9u1A56b4Oid/%E2%9C%8A-Challenge%2Fresponse-in-lobby?node-id=2%3A6400

Yeah do not do anything outside of the feature you are doing to keep it simple.

Sure. Will check the designs.

@umitdogan1
Copy link

@damencho I guess the mobile designs here are for the mobile screens of the web app (not mobile app), right? So, where are the mobile app designs?

@damencho
Copy link
Member

I pass your question, to design ... that link I was given for mobile designs.

@mihaitiberiu
Copy link

@damencho I guess the mobile designs here are for the mobile screens of the web app (not mobile app), right? So, where are the mobile app designs?

-these designs should apply for both mobile web and native apps
-please ignore the "call quality" banner at the top since it's not available on Jitsi

@mkhstar
Copy link

mkhstar commented Feb 26, 2022

Hi everyone,
Currently, the mobile design is completely different from what we are been ask for.
We were also given the pre screen design which I think is not in the scope of our lobby chat implementation. I will be posting
a comparison between the current mobile pre screen and the design pre screen below.

prescreen2

prescreen

@mkhstar
Copy link

mkhstar commented Feb 26, 2022

Also the chat screen of the design is quite different from the designs given.
For example the text inputs, the chat bubble etc.
Screen shots:

chat-message-screen

@damencho
Copy link
Member

Of course don't implement anything that is not for this feature. I think I had summarized earlier what are the needed changes. About the chat area in lobby is that there is no point of the marking of the messages with different colors, both for mobile and web. In lobby the chat should look like a normal chat in the room.

@mihaitiberiu can you also chime in.

@mkhstar mkhstar force-pushed the feat/lobby-chat branch 2 times, most recently from 1b7a82b to 5e6b7cf Compare March 2, 2022 17:48
@umitdogan1
Copy link

@damencho Is it possible to give some priority to our PR? It will be perfect if we can ship the feature this week.

@damencho
Copy link
Member

damencho commented Mar 3, 2022

Jenkins test this please

lobby chat support
knocking participants list updates
knocking participants conditonal checks to show message button
handle lobby chat message events
lobby messages from or to moderators only

Co-authored-by: Fecri Kaan Ulubey <f.kaan93@gmail.com>
@mkhstar
Copy link

mkhstar commented Mar 3, 2022

Linting problems are fixed now

@damencho
Copy link
Member

damencho commented Mar 3, 2022

Jenkins test this please

@damencho
Copy link
Member

damencho commented Mar 3, 2022

I will try to look at it today and tomorrow.

@damencho
Copy link
Member

damencho commented Mar 3, 2022

Jenkins test this please

@damencho damencho merged commit 7522de0 into jitsi:master Mar 3, 2022
@damencho
Copy link
Member

damencho commented Mar 3, 2022

Congrats! Thank you for your contribution.

@umitdogan1
Copy link

Thank you too.

ankit-programmer pushed a commit to ankit-programmer/jitsi-meet that referenced this pull request May 7, 2022
* feat(lobby): lobby chat

lobby chat support
knocking participants list updates
knocking participants conditonal checks to show message button
handle lobby chat message events
lobby messages from or to moderators only

Co-authored-by: Fecri Kaan Ulubey <f.kaan93@gmail.com>

* squash: Drop typos.

Co-authored-by: Kusi Musah Hussein <kusimusah@gmail.com>
Co-authored-by: Fecri Kaan Ulubey <f.kaan93@gmail.com>
Co-authored-by: Дамян Минков <damencho@jitsi.org>
hristoterezov pushed a commit that referenced this pull request Jul 19, 2023
* feat(lobby): lobby chat

lobby chat support
knocking participants list updates
knocking participants conditonal checks to show message button
handle lobby chat message events
lobby messages from or to moderators only

Co-authored-by: Fecri Kaan Ulubey <f.kaan93@gmail.com>

* squash: Drop typos.

Co-authored-by: Kusi Musah Hussein <kusimusah@gmail.com>
Co-authored-by: Fecri Kaan Ulubey <f.kaan93@gmail.com>
Co-authored-by: Дамян Минков <damencho@jitsi.org>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants