Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make gated subreddits accessible by treating them as quarantined #722

Merged
merged 3 commits into from Feb 26, 2023

Conversation

domve
Copy link
Contributor

@domve domve commented Feb 17, 2023

Addresses #697, this would be at least a temporary fix to make gated communities such as r/drugs accessible, as right now there's no way to get past the gated messages.

@ghost
Copy link

ghost commented Feb 17, 2023

This is an important change. Large swaths of reddit have been inaccessible via libreddit for roughly a month. Thanks for authoring it @domve and thanks in advance to whomever reviews it!

@sigaloid
Copy link
Member

Thank you for this PR!

I think it might be a good idea to separate "quarantined" from "gated" - maybe pass the string into quarantine like so:

pub fn quarantine(req: Request<Body>, sub: String, restriction: String) -> Result<Response<Body>, String> {
	let wall = WallTemplate {
		title: format!("r/{} is {restriction}", sub),

The restriction is "quarantined" or "gated", so this works okay.

Also, there's a few other checks in the code for "quarantined" - perhaps those should be checked as well? (search if msg == "quarantined" in the code)

@domve
Copy link
Contributor Author

domve commented Feb 18, 2023

Thanks for the heads up, added checks for the rest of those.

I've also implemented the restriction thing in quarantine, I think it would be worth displaying the warning messages too but it might be neater for me to open a separate PR for it after this gets merged.

@spikecodes spikecodes linked an issue Feb 19, 2023 that may be closed by this pull request
Copy link
Collaborator

@spikecodes spikecodes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me! Thanks for this PR

@Daniel-Valentine Daniel-Valentine merged commit eb07a2c into libreddit:master Feb 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

✨ Feature parity: Allow viewing of gated subreddits
4 participants