Fix replies count when replying to an inbox object

This commit is contained in:
Thomas Sileo 2022-07-31 11:46:45 +02:00
parent cc086f3264
commit cc18e94a81
2 changed files with 8 additions and 1 deletions

View file

@ -321,6 +321,14 @@ async def send_create(
) )
.values(replies_count=models.OutboxObject.replies_count + 1) .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: for (upload, filename, alt_text) in uploads:
attachments.append(upload_to_attachment(upload, filename, alt_text)) attachments.append(upload_to_attachment(upload, filename, alt_text))

View file

@ -83,7 +83,6 @@ _RESIZED_CACHE: MutableMapping[tuple[str, int], tuple[bytes, str, Any]] = LFUCac
# - allow to block servers # - allow to block servers
# - FT5 text search # - FT5 text search
# - support update post with history? # - support update post with history?
# - block support
# - cleanup tasks # - cleanup tasks