Make gated subreddits accessible by treating them as quarantined ()

* Fix gated communities being unviewable by treating them as quarantined

* Show restriction reason in quarantine template

* Add `gated` checks for other requests
This commit is contained in:
domve
2023-02-26 08:40:32 +01:00
committed by GitHub
parent 0b39d4f059
commit eb07a2ce7c
5 changed files with 14 additions and 14 deletions

@ -78,9 +78,9 @@ pub async fn item(req: Request<Body>) -> Result<Response<Body>, String> {
}
// If the Reddit API returns an error, exit and send error page to user
Err(msg) => {
if msg == "quarantined" {
if msg == "quarantined" || msg == "gated" {
let sub = req.param("sub").unwrap_or_default();
quarantine(req, sub)
quarantine(req, sub, msg)
} else {
error(req, msg).await
}