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

removed obsolete code (typo) #1960

Closed

Conversation

githubertus
Copy link
Contributor

i think it was a typo in first place: it was $user_posts here, but entities_pairs are filled with $userS_posts.
so $user_posts never becomes a part of the query
on the other hand the id of the profile page owner is guaranteed to be included already in the friends array on line 172, so it's an unnecessary duplicate anyway and can be removed

i think it was a typo in first place: it was $user_posts here, but entities_pairs are filled with $userS_posts.
so $user_posts never becomes a part of the query
on the other hand the id of the profile page owner is guaranteed to be included already in the friends array on line 172, so it's an unnecessary duplicate anyway and can be removed
@lianglee
Copy link
Member

Yes its was typo and fixing typo results wrong result :)
However :

image

This line is useless then without entities_pairs name, value this line will never be called./

Dump of getUserPosts when friend is loggedin and seeing user profile, here entities_pairs[1] is useless as it have no name param.

image

With non friend seeing user profile

image

I think it worked because if not a friend (emd0.value=2) is set in wheres.

So these lines are useless

image

Few things getting in my mind:

  1. What if userA and userB are friends, userC and UserB are friends, userA blocked UserC, userA posted on UserB and What will happen if userC visits userB wall.

@lianglee
Copy link
Member

If I am right regarding usless two lines then we need to adjust if statement as the lines not needed.
And the above thing in my mind will be taken care about user blocks component.

What do you think?

lianglee added a commit that referenced this pull request Jul 10, 2021
lianglee added a commit that referenced this pull request Jul 10, 2021
Strip posts for blocked users (logged and poster_guid) but not for profile owner
@lianglee
Copy link
Member

This can be now closed because of above two commits resolves the problem.

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.

None yet

2 participants