From 8d80fb7227ef324f86677db1166ee8f1da576940 Mon Sep 17 00:00:00 2001 From: Dessalines Date: Mon, 23 Oct 2023 14:41:22 -0400 Subject: [PATCH] Filter out bot instances. --- src/shared/components/instances.tsx | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/shared/components/instances.tsx b/src/shared/components/instances.tsx index 1071817..23490db 100644 --- a/src/shared/components/instances.tsx +++ b/src/shared/components/instances.tsx @@ -406,6 +406,14 @@ export class Instances extends Component { } } + isOpenInstance(i: any): boolean { + return !( + i.site_info.site_view.local_site.registration_mode !== "Open" || + i.site_info.site_view.local_site.captcha_enabled || + i.site_info.site_view.local_site.require_email_verification + ); + } + buildInstanceList() { let instances = instance_stats.stats.instance_details; const recommended = RECOMMENDED_INSTANCES; @@ -430,6 +438,9 @@ export class Instances extends Component { ); } + // Filter out all open instances (often used by bots) + instances = instances.filter(i => !this.isOpenInstance(i)); + // Sort if (this.state.sort == RANDOM_SORT) { instances = sortRandom(instances);