diff --git a/app/activitypub/routes.py b/app/activitypub/routes.py index 1378fac8..6b60d590 100644 --- a/app/activitypub/routes.py +++ b/app/activitypub/routes.py @@ -1030,7 +1030,8 @@ def process_inbox_request(request_json, activitypublog_id, ip_address): if can_delete(request_json['actor'], reply): reply.body_html = '

deleted

' reply.body = 'deleted' - reply.post.reply_count -= 1 + if not reply.author.bot: + reply.post.reply_count -= 1 reply.deleted = True announce_activity_to_followers(reply.community, reply.author, request_json) db.session.commit() diff --git a/app/activitypub/util.py b/app/activitypub/util.py index 7e1af065..b642d834 100644 --- a/app/activitypub/util.py +++ b/app/activitypub/util.py @@ -1414,7 +1414,8 @@ def delete_post_or_comment_task(user_ap_id, community_ap_id, to_be_deleted_ap_id community.post_count -= 1 db.session.commit() elif isinstance(to_delete, PostReply): - to_delete.post.reply_count -= 1 + if not to_delete.author.bot: + to_delete.post.reply_count -= 1 if to_delete.has_replies(): to_delete.body = 'Deleted by author' if to_delete.author.id == deletor.id else 'Deleted by moderator' to_delete.body_html = lemmy_markdown_to_html(to_delete.body) @@ -1454,7 +1455,8 @@ def remove_data_from_banned_user_task(deletor_ap_id, user_ap_id, target): return for post_reply in post_replies: - post_reply.post.reply_count -= 1 + if not user.bot: + post_reply.post.reply_count -= 1 if post_reply.has_replies(): post_reply.body = 'Banned' post_reply.body_html = lemmy_markdown_to_html(post_reply.body)