From e78dd304bee5fcbdc349c287b31819807e48e58f Mon Sep 17 00:00:00 2001 From: rimu <3310831+rimu@users.noreply.github.com> Date: Thu, 28 Mar 2024 09:24:13 +1300 Subject: [PATCH] record last activity in a conversation --- app/activitypub/routes.py | 1 + app/chat/util.py | 1 + 2 files changed, 2 insertions(+) diff --git a/app/activitypub/routes.py b/app/activitypub/routes.py index d3254f5f..4d6aaa42 100644 --- a/app/activitypub/routes.py +++ b/app/activitypub/routes.py @@ -419,6 +419,7 @@ def process_inbox_request(request_json, activitypublog_id, ip_address): body_html=allowlist_html(markdown_to_html(request_json['object']['source']['content'])), encrypted=encrypted) db.session.add(new_message) + existing_conversation.updated_at = utcnow() db.session.commit() # Notify recipient diff --git a/app/chat/util.py b/app/chat/util.py index ee78e4a6..8b149641 100644 --- a/app/chat/util.py +++ b/app/chat/util.py @@ -13,6 +13,7 @@ def send_message(message: str, conversation_id: int) -> ChatMessage: conversation = Conversation.query.get(conversation_id) reply = ChatMessage(sender_id=current_user.id, conversation_id=conversation.id, body=message, body_html=allowlist_html(markdown_to_html(message))) + conversation.updated_at = utcnow() for recipient in conversation.members: if recipient.id != current_user.id: if recipient.is_local():