Bugfix: also federate post deletion by post owners #341

This commit is contained in:
freamon 2024-10-21 23:03:53 +00:00
parent af3bc4f0dd
commit 0274682adc

View file

@ -1054,7 +1054,7 @@ def post_delete_post(community: Community, post: Post, user_id: int, federate_al
# Federation # Federation
if not community.local_only: # local_only communities do not federate if not community.local_only: # local_only communities do not federate
# if this is a remote community and we are a mod of that community # if this is a remote community and we are a mod of that community
if not post.community.is_local() and user.is_local() and (community.is_moderator(user) or community.is_owner(user)): if not post.community.is_local() and user.is_local() and (post.user_id == user.id or community.is_moderator(user) or community.is_owner(user)):
post_request(post.community.ap_inbox_url, delete_json, user.private_key, user.public_url() + '#main-key') post_request(post.community.ap_inbox_url, delete_json, user.private_key, user.public_url() + '#main-key')
elif post.community.is_local(): # if this is a local community - Announce it to followers on remote instances elif post.community.is_local(): # if this is a local community - Announce it to followers on remote instances
announce = { announce = {