From cc18e94a81dd3ca31486a1df3dad0b577a98229f Mon Sep 17 00:00:00 2001 From: Thomas Sileo Date: Sun, 31 Jul 2022 11:46:45 +0200 Subject: [PATCH] Fix replies count when replying to an inbox object --- app/boxes.py | 8 ++++++++ app/main.py | 1 - 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/app/boxes.py b/app/boxes.py index 5a140ca..9169ef9 100644 --- a/app/boxes.py +++ b/app/boxes.py @@ -321,6 +321,14 @@ async def send_create( ) .values(replies_count=models.OutboxObject.replies_count + 1) ) + elif in_reply_to_object.is_from_inbox: + await db_session.execute( + update(models.InboxObject) + .where( + models.InboxObject.ap_id == in_reply_to, + ) + .values(replies_count=models.InboxObject.replies_count + 1) + ) for (upload, filename, alt_text) in uploads: attachments.append(upload_to_attachment(upload, filename, alt_text)) diff --git a/app/main.py b/app/main.py index 793b7f3..728eba3 100644 --- a/app/main.py +++ b/app/main.py @@ -83,7 +83,6 @@ _RESIZED_CACHE: MutableMapping[tuple[str, int], tuple[bytes, str, Any]] = LFUCac # - allow to block servers # - FT5 text search # - support update post with history? -# - block support # - cleanup tasks