Filter out bot instances.

This commit is contained in:
Dessalines 2023-10-23 14:41:22 -04:00
parent 5478a493da
commit 8d80fb7227

View file

@ -406,6 +406,14 @@ export class Instances extends Component<Props, State> {
}
}
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<Props, State> {
);
}
// 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);