feat: keep testing rooms off site

dev
gravel 6 months ago
parent 5dabdb4ebb
commit c798a26e13
Signed by: gravel
GPG Key ID: C0538F3C906B308F

@ -413,13 +413,6 @@ function hideBadCommunities() {
.reduce((a, b) => a + b);
}
for (const row of dom.tbl_communities_content_rows()) {
const rowInfo = dom.row_info(row);
if (rowInfo.tags.some((tag) => tag.text === "test")) {
numberOfHiddenCommunities += hideCommunity(rowInfo.identifier);
}
}
const summary = dom.servers_hidden();
summary.innerText = `(${numberOfHiddenCommunities} hidden)`;
}

@ -231,7 +231,7 @@
* Returns true if room should not be reflected in listings.
*/
public function is_off_record(): bool {
return !$this->read;
return !$this->read || $this->is_testing_room();
}
/**
@ -499,6 +499,11 @@
return $this->has_nsfw_keywords() || $this->matched_by_list($NSFW_INCLUDE);
}
public function is_testing_room(): bool {
global $TESTING_INCLUDE;
return in_array("test", $this->tags) || $this->matched_by_list($TESTING_INCLUDE);
}
/**
* Determine the safety of the Community's icon.
* @return 1 if safe, -1 if unsafe, 0 if unknown.

Loading…
Cancel
Save