Skip to content

Commit

Permalink
fix(matrix_lobby_bypass): regex
Browse files Browse the repository at this point in the history
  • Loading branch information
emrahcom committed Oct 17, 2024
1 parent ebf8a82 commit 6a17e19
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions auth_hybrid_matrix_token/mod_matrix_lobby_bypass.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
-- room name to understand if this room is created by widget or not...
--
-- There are two possible formats for Jitsi room names created by widget:
-- - jitsi_room_name should match "jitsi[a-z]{24}" (regex) or
-- - base32.decode(jitsi_room_name) should match "!.*:.*[.].*" (regex)
-- - jitsi_room_name should match "^jitsi[a-z]{24}$" (regex) or
-- - base32.decode(jitsi_room_name) should match "^!.*:.*[.].*" (regex)
--
-- If the participant is already a valid member of Matrix's room then no need to
-- check her again in Jitsi lobby.
Expand Down Expand Up @@ -38,7 +38,7 @@ module:hook("muc-occupant-pre-join", function (event)
local roomName, _ = jid_split(room.jid)
local isMatrixRoomName = string.match(
roomName,
"jitsi%l%l%l%l%l%l%l%l%l%l%l%l%l%l%l%l%l%l%l%l%l%l%l%l"
"^jitsi%l%l%l%l%l%l%l%l%l%l%l%l%l%l%l%l%l%l%l%l%l%l%l%l$"
)

-- if it doesnt match the first format, check the second possible format
Expand All @@ -49,7 +49,7 @@ module:hook("muc-occupant-pre-join", function (event)
return
end

local isMatrixRoomId = string.match(roomId, "!.*:.*[.].*")
local isMatrixRoomId = string.match(roomId, "^!.*:.*[.].*")
if not isMatrixRoomId then
module:log(LOGLEVEL, "skip lobby_bypass, not a Matrix room")
return
Expand Down

0 comments on commit 6a17e19

Please sign in to comment.