Skip to content

Conversation

@srijan2607
Copy link
Contributor

This pull request adds logic to update session variables when an occupant joins a room, ensuring compatibility with features like polls that depend on accurate session context.

Session variable updates for room joins:

  • In mod_muc_breakout_rooms.lua, the on_occupant_joined function now updates each session's jitsi_web_query_room and jitsi_web_query_prefix when a user (excluding the 'focus' user) joins a room. This ensures that session context is correct for downstream components such as polls.

Related issue : #16693

@srijan2607
Copy link
Contributor Author

@damencho please take a look

@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 :(.

@damencho
Copy link
Member

I don't think that is the correct approach to change every session on every join. I will take a look at that in the next weeks.

@srijan2607
Copy link
Contributor Author

@damencho Here's another approach I discovered by analysing how other Prosody components handle room context

Including Room JID in Messages (Like Visitor Nodes)

I investigated how other components handle room context and found something interesting: the polls component already supports getting room from the message itself but only for visitor nodes

Looking at mod_polls_component.lua (lines 140-149), it already has this pattern

if session.type == 's2sin' then
    room = get_room_from_jid(room_jid_match_rewrite(json_message.attr.roomJid));
else
    room = get_room_by_name_and_subdomain(session.jitsi_web_query_room, session.jitsi_web_query_prefix);
end

we can Extend this pattern to regular clients not just visitor nodes.

I'm happy to implement this approach or wait for your review. Let me know what you think

@damencho
Copy link
Member

Nope, that is not a good idea, visitors are trusted source, I mean the thing that puts roomJid is a trusted source when it comes to visitors, but we cannot trust that when someone else is sending the message.

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