Skip to content

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.

* feat: Stores vpaas check in room object.

Дамян Минков5871e50a2009
diff --git a/doc/jaas/move-to-jaas.sh b/doc/jaas/move-to-jaas.sh
index 3d6af3f669..a7ba43cd27 100755
--- a/doc/jaas/move-to-jaas.sh
+++ b/doc/jaas/move-to-jaas.sh
@@ -38,9 +38,9 @@ apt install token-generator
mkdir -p /etc/jitsi/meet/jaas
-VPASS_COOKIE=$(echo -n ${JAAS_KEY_ID}| cut -d/ -f1)
+VPAAS_COOKIE=$(echo -n ${JAAS_KEY_ID}| cut -d/ -f1)
cp /usr/share/jitsi-meet-web-config/nginx-jaas.conf /etc/jitsi/meet/jaas
-sed -i "s/jaas_magic_cookie/${VPASS_COOKIE}/g" /etc/jitsi/meet/jaas/nginx-jaas.conf
+sed -i "s/jaas_magic_cookie/${VPAAS_COOKIE}/g" /etc/jitsi/meet/jaas/nginx-jaas.conf
cp /usr/share/jitsi-meet-web-config/8x8.vc-config.js /etc/jitsi/meet/jaas/
echo "set \$config_js_location /etc/jitsi/meet/jaas/8x8.vc-config.js;" >> /etc/jitsi/meet/jaas/jaas-vars
diff --git a/resources/prosody-plugins/mod_fmuc.lua b/resources/prosody-plugins/mod_fmuc.lua
index 1976c4cbe5..a3a93477f8 100644
--- a/resources/prosody-plugins/mod_fmuc.lua
+++ b/resources/prosody-plugins/mod_fmuc.lua
@@ -193,8 +193,8 @@ module:hook('muc-broadcast-presence', function (event)
local session = sessions[occupant.jid];
local identity = session and session.jitsi_meet_context_user;
- if is_vpaas(room.jid) and identity then
- -- in case of moderator in vpass meeting we want to do auto-promotion
+ if is_vpaas(room) and identity then
+ -- in case of moderator in vpaas meeting we want to do auto-promotion
local is_vpaas_moderator = identity.moderator;
if is_vpaas_moderator == 'true' or is_vpaas_moderator == true then
is_moderator = true;
diff --git a/resources/prosody-plugins/mod_muc_rate_limit.lua b/resources/prosody-plugins/mod_muc_rate_limit.lua
index 85d1c806f3..612984bee7 100644
--- a/resources/prosody-plugins/mod_muc_rate_limit.lua
+++ b/resources/prosody-plugins/mod_muc_rate_limit.lua
@@ -57,7 +57,7 @@ end
-- process join_rate_presence_queue in the room and pops element passing them to handle_normal_presence
-- returns 1 if we want to reschedule it after 1 second
local function timer_process_queue_elements (rate, queue, process, queue_empty_cb)
- if not queue or queue:count() == 0 then
+ if not queue or queue:count() == 0 or queue.empty then
return;
end
@@ -152,7 +152,12 @@ end, 9); -- as we will rate limit joins we need to be the first to execute
-- clear queue on room destroy so timer will skip next run if any
module:hook('muc-room-destroyed',function(event)
- event.room.join_rate_presence_queue = nil;
+ if event.room.join_rate_presence_queue then
+ event.room.join_rate_presence_queue.empty = true;
+ end
+ if event.room.leave_rate_presence_queue then
+ event.room.leave_rate_presence_queue.empty = true;
+ end
end);
module:hook('muc-occupant-pre-leave', function (event)
diff --git a/resources/prosody-plugins/mod_visitors_component.lua b/resources/prosody-plugins/mod_visitors_component.lua
index f1a43cee32..8c89918cdb 100644
--- a/resources/prosody-plugins/mod_visitors_component.lua
+++ b/resources/prosody-plugins/mod_visitors_component.lua
@@ -216,8 +216,8 @@ local function stanza_handler(event)
end
local force_promote = request_promotion.attr.forcePromote;
- if force_promote == 'true' and not is_vpaas(room.jid) then
- module:log('warn', 'Received promotion request for non vpass room (%s) with forced promotion: ',
+ if force_promote == 'true' and not is_vpaas(room) then
+ module:log('warn', 'Received promotion request for non vpaas room (%s) with forced promotion: ',
room.jid, stanza);
return true; -- stop processing
end
diff --git a/resources/prosody-plugins/util.lib.lua b/resources/prosody-plugins/util.lib.lua
index ace0acd1a9..0d997c264a 100644
--- a/resources/prosody-plugins/util.lib.lua
+++ b/resources/prosody-plugins/util.lib.lua
@@ -416,25 +416,35 @@ function is_moderated(room_jid)
return false;
end
--- check if the room tenant starts with
--- vpaas-magic-cookie-
-function is_vpaas(room_jid)
- local node, host = jid.split(room_jid);
+-- check if the room tenant starts with vpaas-magic-cookie-
+-- @param room the room to check
+function is_vpaas(room)
+ if not room then
+ return false;
+ end
+
+ -- stored check in room object if it exist
+ if room.is_vpaas ~= nil then
+ return room.is_vpaas;
+ end
+
+ room.is_vpaas = false;
+
+ local node, host = jid.split(room.jid);
if host ~= muc_domain or not node then
- module:log('debug', 'Not the same host');
return false;
end
local tenant, conference_name = node:match('^%[([^%]]+)%](.+)$');
if not (tenant and conference_name) then
- module:log('debug', 'Not a vpaas room %s', room_jid);
return false;
end
- local vpaas_prefix, _ = tenant:match('^(vpaas%-magic%-cookie%-)(.*)$')
- if vpaas_prefix ~= 'vpaas-magic-cookie-' then
- module:log('debug', 'Not a vpaas room %s', room_jid);
- return false
+
+ if not starts_with(tenant, 'vpaas-magic-cookie-') then
+ return false;
end
- return true
+
+ room.is_vpaas = true;
+ return true;
end
return {