-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Only show users that the doer has access to #20169
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
Conversation
Gusted
commented
Jun 28, 2022
- Don't show users to the doer hasn't access to(user's visibility set to private or limited).
- This PR fixes this problem for User's followers and User's followings and uses a unified option struct(given only one condition changes, it's not worth the duplicated code).
- Don't show users to the doer hasn't access to(user's visibility set to private or limited). - This PR fixes this problem for User's followers and User's followings and uses a unified option struct(given only one condition changes, it's not worth the duplicated code).
Join("LEFT", "follow", "`user`.id=follow.follow_id") | ||
func GetUserFollowing(ctx context.Context, opts GetUserFollowOptions) ([]*User, int64, error) { | ||
sess := db.GetEngine(ctx). | ||
Join("LEFT", "follow", "`user`.id=follow.follow_id"). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't these be INNER JOINs instead of LEFT JOINs? In this case it does not change the result because of the WHERE clause.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm just copying the previous code. I really don't want to make any more changes that doesn't cover the scope of the PR. It just leads to regressions and problems and arguments that I don't feel like fighting. But yeah it seems you're right we should only target followers that correspond to a existent user in the database, do you want to make a separate pull request for it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I will create a PR.
Superseded by #20220 |