Handle displaying of deleted and removed posts/comments (fixes #2624)
Makes it so that deleted and removed posts/comments are only shown on the creator's profile page in the following cases:
- When user views his own profile, he can view all posts/comments which he deleted himself (but not those which were deleted by mod actions)
- When admin views user profile, he can see all posts/comments which were deleted by mod actions (but not those deleted by the user himself)
The existing code would also show deleted/removed posts and comments to admins/mods in post listings and search results, I dont think thats desirable.
- did some cleanup for tests but not finished yet (still failing)
- changed it so that a user can always see their own deleted posts, not only in profile
- might be useful to show removed posts/comments in moderator view but not sure about this (https://github.com/LemmyNet/lemmy/pull/3176)
Clippy failing.
~~Need to merge https://github.com/LemmyNet/lemmy/pull/3613 first.~~
Edit: actually not, because this PR doesnt change PostView::read. So this is ready to merge
Added another change to allow returning own deleted posts from PostView::read, which makes https://github.com/LemmyNet/lemmy/pull/3613 obsolete. I tested to confirm that its working for unauthenticated users.