Only show users that the doer has access to#20169
Closed
Gusted wants to merge 5 commits into
Closed
Conversation
Contributor
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).
added 3 commits
June 27, 2022 15:14
- 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).
wxiaoguang
reviewed
Jun 28, 2022
KN4CK3R
reviewed
Jun 29, 2022
KN4CK3R
reviewed
Jun 30, 2022
| 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"). |
Member
There was a problem hiding this comment.
Shouldn't these be INNER JOINs instead of LEFT JOINs? In this case it does not change the result because of the WHERE clause.
Contributor
Author
There was a problem hiding this comment.
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?
KN4CK3R
approved these changes
Jul 1, 2022
Contributor
Author
|
Superseded by #20220 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.