diff --git a/doc/jaas/move-to-jaas.sh b/doc/jaas/move-to-jaas.sh index 3d6af3f669ae..a7ba43cd27e1 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 1976c4cbe571..a3a93477f8dd 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_visitors_component.lua b/resources/prosody-plugins/mod_visitors_component.lua index f1a43cee32b4..8c89918cdbf5 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 ace0acd1a9e4..65405b382355 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 + return false; end - return true + + room.is_vpaas = true; + return true; end return {