Skip to content

Conversation

@jaywink
Copy link
Member

@jaywink jaywink commented Jan 21, 2021

When the user joins the conference, we catch the
muc-occupant-joined event and make them an owner
if they were marked as one during auth.

During auth, if we get power levels back from UVS
(see matrix-org/matrix-user-verification-service#7), we compare the users power level in the
room to "state_default" of the room and if the
user is equal or more, we mark them as owner.
This allows them to do moderation in the Jitsi
conference side.

When the user joins the conference, we catch the
`muc-occupant-joined` event and make them an owner
if they were marked as one during auth.

During auth, if we get power levels back from UVS
(see matrix-org/matrix-user-verification-service#7), we compare the users power level in the
room to "state_default" of the room and if the
user is equal or more, we mark them as owner.
This allows them to do moderation in the Jitsi
conference side.
Copy link
Member

@dbkr dbkr left a comment

Choose a reason for hiding this comment

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

otherwise lgtm

end

-- Store the isOwner detail
session.auth_matrix_user_verification_is_owner = isOwner
Copy link
Member

Choose a reason for hiding this comment

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

hmm, may be worth adding the room name either as a separate variable or to the name of this one? Otherwise I wonder if it would be possible to auth yourself against one matrix room but then gain moderator status in a different jitsi conference, somehow.

Copy link
Member Author

Choose a reason for hiding this comment

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

Hmm, I'm not entirely sure. I was thinking of adding the Jitsi room name, but it's already in the session. And using a session for some room against another room seems unlikely to be possible, considering these are internal structures according to the Prosody team?

There is this above: if not (target_room_name == session.jitsi_meet_room) then which if the check failes does not owner the user in the room. I'm not entirely sure why that is there, I took it from the Jitsi Meet plugin that admins everyone (https://github.com/jitsi/jitsi-meet/blob/master/resources/prosody-plugins/mod_muc_allowners.lua#L63), but it's possible it's something to do with ensuring the session is for this particular room. If that is the case, it will also protect in this case I believe.

Adding the room name here and checking it in the later phase could be done but it feels like that is already happening. We don't have the matrix room ID in the "participant joined" hook, so we can't really compare to that, and the jitsi room name is already being compared to the one in the session.

Copy link
Member

Choose a reason for hiding this comment

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

ah ok, if that jitsi room name in the session is defined to be the one matching where the power levels come from then yeah, it should be fine

@jaywink jaywink merged commit 54df3a8 into master Jan 22, 2021
@jaywink jaywink deleted the jaywink/room-owner branch January 22, 2021 15:47
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.

3 participants