And sorry I mixed up the names "DeletePost" with an imagined "PostDelete" in some descriptions. At least I got "EditPost" correct, but the code does sometimes use "NoPostEditAllowed", with the "PostEdit" instead of "EditPost".
That change wouldnt help as it only changes PostQuery::read, which isnt used in this case. Basically the same changes would have to be applied to PostView::read which is the method used by build_post_response.
Ah I understand it now. The SendActivity trait relies on the return value of the api call to send the activity. However delete/remove post api calls currently dont return the PostView unless the user is an admin (which is probably the reason that tests are still passing).
This PR is a good short-term fix which we should include in 0.18.3. Later the problem will get fixed with https://github.com/LemmyNet/lemmy/pull/3596 which gets rid of SendActivity, and has explicit function calls for each activity send.
@RocketDerp You need to run cargo +nightly fmt --all to make CI pass.
Edit: I wonder if the same problem happens with other actions. Delete/remove comment is fine because CommentView::read doesnt filter for removed/deleted at all, not sure if thats intentional. An alternative fix for this problem would be to change PostView::read so that it doesnt filter for removed/deleted in case my_person_id is the post creator. That would actually be a much cleaner solution.
An alternative fix for this problem would be to change PostView::read so that it doesnt filter for removed/deleted in case my_person_id is the post creator. That would actually be a much cleaner solution.