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

Ability to follow and unfollow a user #1166

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

folkemat
Copy link
Contributor

@folkemat folkemat commented Jan 9, 2024

Hi, this PR adds the ability to follow and unfollow a user.

  • There is now a Follow / Unfollow button in the profile
  • Since following is nothing more than subscribing to a subreddit called "u_username", followed users appear in the main menu under "Subscribed Subreddits"
  • Followed users get a "Followed" chip in their profile

Closes #1156 and #700

What do you think? I look forward to your feedback

@folkemat
Copy link
Contributor Author

folkemat commented Jan 9, 2024

I've noticed that if you follow a user using the "u_username" scheme, e.g. "u_spez", a subreddit "/user/spez" (which opens the profile) and one called "u_spez" (which actually shows the posts in "r/u_spez") are created: u_spez is removed when the main menu is refreshed, while /user/spez only appears after the refresh.

No idea why that is, but I don't know the code much either, maybe you have an explanation @QuantumBadger? Or is it a Reddit thing? reddit.com/r/u_spez also automatically redirects to reddit.com/user/spez.

So..

  • To follow you have to use the u_username scheme, because /user/username doesn't work.
  • To unfollow, you can use both schemas, but we have to test if we should use u_username or /user/username works, because who knows if u_spez was already upgraded to /user/spez or not.
  • And to display the chip and the correct buttons we also have to check both for the same reason

I have now simply solved it by testing for both, but maybe it is better to somehow trigger an refresh after following?

@folkemat
Copy link
Contributor Author

I just noticed: The whole thing now has to be adapted to the block/unblock behaviour; no toast messages, but greyed out (un)follow loading buttons. I'll do that soon

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature Request] View & Subscribe to User Subreddit
2 participants