From 4f0812988be0aa0f8a310d807e00312354dbda4d Mon Sep 17 00:00:00 2001 From: Thomas Sileo Date: Sun, 18 Aug 2019 19:05:46 +0200 Subject: [PATCH] Fix reply delete from inbox --- core/inbox.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/core/inbox.py b/core/inbox.py index e9465b5..751417f 100644 --- a/core/inbox.py +++ b/core/inbox.py @@ -52,7 +52,13 @@ def _delete_process_inbox(delete: ap.Delete, new_meta: _NewMeta) -> None: ) ) if in_reply_to: - DB.activities.update_one(post_query, inc(MetaKey.COUNT_REPLY, -1)) + DB.activities.update_one( + {**by_object_id(in_reply_to), **by_type(ap.ActivityType.CREATE)}, + inc(MetaKey.COUNT_REPLY, -1), + ) + DB.replies.update_one( + by_remote_id(in_reply_to), inc(MetaKey.COUNT_REPLY, -1) + ) except Exception: _logger.exception(f"failed to handle delete replies for {obj_id}")