fix(idaa): fall back to site config group list when g_uuid not in URL

Older Novi pages that haven't been updated to pass g_uuid still need
the moderator check to work. Use [g_uuid] when present, otherwise fall
back to novi_idaa_group_guid_li from site config.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Scott Idem
2026-03-27 14:31:34 -04:00
parent f111670f60
commit 27f0bd21fb

View File

@@ -477,15 +477,20 @@ async function fetch_novi_data() {
}
}
// Use the group UUID from the URL param to check membership in that specific group.
// Each Jitsi iframe page passes the relevant group's UUID — this is more precise than
// checking against a global list of all IDAA moderator groups from site config.
// Moderator group check: prefer the g_uuid passed per-meeting in the URL (more precise),
// fall back to the global novi_idaa_group_guid_li from site config for older Novi pages
// that haven't been updated to pass g_uuid yet.
const group_uuid = url_params.g_uuid ?? null;
if (!group_uuid) {
console.warn('Jitsi: No g_uuid in URL — skipping group moderator check.');
const group_guid_li = group_uuid
? [group_uuid]
: ($ae_loc.site_cfg_json?.novi_idaa_group_guid_li ?? []);
if (group_uuid) {
console.log(`Jitsi: Checking moderator via URL g_uuid: ${group_uuid}`);
} else {
console.log(`Jitsi: No g_uuid in URL — falling back to site config group list (${group_guid_li.length} groups).`);
}
const moderatorIdSet = await get_novi_group_moderators(
group_uuid ? [group_uuid] : [],
group_guid_li,
novi_api_root_url,
novi_api_key
);