Work on IDAA and Novi auth
This commit is contained in:
@@ -626,15 +626,14 @@ async function get_novi_group_moderators(
|
||||
const requestOptions = { method: 'GET', headers: headers };
|
||||
let allModeratorsRaw: any[] = [];
|
||||
|
||||
if (log_lvl) {
|
||||
console.log('Jitsi: Fetching Novi group moderators...');
|
||||
}
|
||||
console.log('[DEBUG] Novi Moderator Group Fetch:');
|
||||
console.log(' Group GUIDs:', group_guid_li);
|
||||
console.log(' Novi API Root URL:', api_root_url);
|
||||
|
||||
for (const group_guid of group_guid_li) {
|
||||
const url = `${api_root_url}/groups/${group_guid}/members?pageSize=200`;
|
||||
console.log(
|
||||
`Jitsi: Fetching moderator list for group ${group_guid} from: ${url}`
|
||||
);
|
||||
console.log(`[DEBUG] Fetching moderator list for group:`, group_guid);
|
||||
console.log(' Request URL:', url);
|
||||
|
||||
try {
|
||||
const response = await fetch(url, requestOptions);
|
||||
@@ -647,42 +646,40 @@ async function get_novi_group_moderators(
|
||||
groupModList = result.Results;
|
||||
else if (Array.isArray(result.Members))
|
||||
groupModList = result.Members;
|
||||
else
|
||||
else {
|
||||
console.warn(
|
||||
`Jitsi: Moderator list format unexpected for group ${group_guid}.`,
|
||||
`[DEBUG] Moderator list format unexpected for group ${group_guid}. Raw result:`,
|
||||
result
|
||||
);
|
||||
}
|
||||
|
||||
allModeratorsRaw = allModeratorsRaw.concat(groupModList);
|
||||
if (log_lvl) {
|
||||
console.log(
|
||||
`Jitsi: Fetched ${groupModList.length} moderators from group ${group_guid}. Total: ${allModeratorsRaw.length}`
|
||||
);
|
||||
console.log(
|
||||
`[DEBUG] Group ${group_guid}: fetched ${groupModList.length} moderators. Total so far: ${allModeratorsRaw.length}`
|
||||
);
|
||||
if (groupModList.length > 0) {
|
||||
console.log(`[DEBUG] First 3 moderator objects:`, groupModList.slice(0, 3));
|
||||
}
|
||||
} else {
|
||||
console.warn(
|
||||
`Jitsi: Failed to fetch moderators for group ${group_guid}. Status: ${response.status}`
|
||||
`[DEBUG] Failed to fetch moderators for group ${group_guid}. Status: ${response.status}`
|
||||
);
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(
|
||||
`Jitsi: Error fetching moderators for group ${group_guid}:`,
|
||||
`[DEBUG] Error fetching moderators for group ${group_guid}:`,
|
||||
error
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if (allModeratorsRaw.length === 0) {
|
||||
console.warn(
|
||||
'Jitsi: No moderators found across all specified Novi groups.'
|
||||
);
|
||||
console.warn('[DEBUG] No moderators found across all specified Novi groups.');
|
||||
}
|
||||
|
||||
if (log_lvl > 1) {
|
||||
console.log(
|
||||
'Jitsi: Fetched all raw moderators (combined):',
|
||||
allModeratorsRaw
|
||||
);
|
||||
console.log('[DEBUG] Combined moderator list count:', allModeratorsRaw.length);
|
||||
if (allModeratorsRaw.length > 0) {
|
||||
console.log('[DEBUG] Example moderator IDs:', allModeratorsRaw.slice(0, 5).map(m => m?.UniqueID || m?.UniqueId || m?.DuesPayerUniqueID || m?.id || ''));
|
||||
}
|
||||
|
||||
const modIdSet = new Set(
|
||||
@@ -698,6 +695,7 @@ async function get_novi_group_moderators(
|
||||
.filter(Boolean)
|
||||
.map((id: string) => String(id).toLowerCase().trim())
|
||||
);
|
||||
console.log('[DEBUG] Final moderator ID set:', Array.from(modIdSet));
|
||||
return modIdSet;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user