mirror of
https://github.com/LemmyNet/joinlemmy-site.git
synced 2024-11-22 20:31:17 +00:00
Filter out bot instances.
This commit is contained in:
parent
5478a493da
commit
8d80fb7227
1 changed files with 11 additions and 0 deletions
|
@ -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() {
|
buildInstanceList() {
|
||||||
let instances = instance_stats.stats.instance_details;
|
let instances = instance_stats.stats.instance_details;
|
||||||
const recommended = RECOMMENDED_INSTANCES;
|
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
|
// Sort
|
||||||
if (this.state.sort == RANDOM_SORT) {
|
if (this.state.sort == RANDOM_SORT) {
|
||||||
instances = sortRandom(instances);
|
instances = sortRandom(instances);
|
||||||
|
|
Loading…
Reference in a new issue