소스 검색

Fix mod_muc_max_occupants to properly ignore whitelisted users

In a typical Jitsi Meet setup, this plugin can be used to limit the number of
occupants in a meeting room, while ignoring "utility" users. Such a
configuration could be:

    muc_max_occupants = 2
    muc_access_whitelist = {
        "focus@auth.meet.jitsi";
    }

It would be expected that this configuration allows two users to attend the
meeting room, but in practice only one is allowed, because the whitelist is not
honoured.

This commit fixes it by actually updating the `user` and `domain` variables
being checked. After this change, the scenario above works just fine.
j8
Steve Frécinaux 5 년 전
부모
커밋
aff6d4b36d
1개의 변경된 파일1개의 추가작업 그리고 0개의 파일을 삭제
  1. 1
    0
      resources/prosody-plugins/mod_muc_max_occupants.lua

+ 1
- 0
resources/prosody-plugins/mod_muc_max_occupants.lua 파일 보기

46
 		-- For each person in the room that's not on the whitelist, subtract one
46
 		-- For each person in the room that's not on the whitelist, subtract one
47
 		-- from the count.
47
 		-- from the count.
48
 		for _, occupant in room:each_occupant() do
48
 		for _, occupant in room:each_occupant() do
49
+			user, domain, res = split_jid(occupant.bare_jid);
49
 			if not whitelist:contains(domain) and not whitelist:contains(user..'@'..domain) then
50
 			if not whitelist:contains(domain) and not whitelist:contains(user..'@'..domain) then
50
 				slots = slots - 1
51
 				slots = slots - 1
51
 			end
52
 			end

Loading…
취소
저장