mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-10-29 17:02:28 +00:00
Filter trusted seeds against access control blacklist
This commit is contained in:
1 parent
24ce44833b
commit
4809b8dac6
1 file changed
+4
-3
@@ -639,19 +639,20 @@ export class ModerationService {
|
||||
this.log("[moderationService] setTrustedSeeds called", { count: seeds?.length || seeds?.size || 0 });
|
||||
const sanitizedSeeds = new Set();
|
||||
const adminSnapshot = this.getAdminListSnapshot();
|
||||
const blacklistHex = adminSnapshot.blacklistHex;
|
||||
|
||||
if (seeds instanceof Set || Array.isArray(seeds)) {
|
||||
for (const candidate of seeds) {
|
||||
const normalized = normalizeToHex(candidate);
|
||||
if (normalized && (!blacklistHex || !blacklistHex.has(normalized))) {
|
||||
const status = this.getAccessControlStatus(candidate, adminSnapshot);
|
||||
if (normalized && !status.blacklisted) {
|
||||
sanitizedSeeds.add(normalized);
|
||||
}
|
||||
}
|
||||
} else if (seeds && typeof seeds[Symbol.iterator] === "function") {
|
||||
for (const candidate of seeds) {
|
||||
const normalized = normalizeToHex(candidate);
|
||||
if (normalized && (!blacklistHex || !blacklistHex.has(normalized))) {
|
||||
const status = this.getAccessControlStatus(candidate, adminSnapshot);
|
||||
if (normalized && !status.blacklisted) {
|
||||
sanitizedSeeds.add(normalized);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user