record last activity in a conversation

This commit is contained in:
rimu 2024-03-28 09:24:13 +13:00
parent 12fc9654d3
commit e78dd304be
2 changed files with 2 additions and 0 deletions

View file

@ -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'])), body_html=allowlist_html(markdown_to_html(request_json['object']['source']['content'])),
encrypted=encrypted) encrypted=encrypted)
db.session.add(new_message) db.session.add(new_message)
existing_conversation.updated_at = utcnow()
db.session.commit() db.session.commit()
# Notify recipient # Notify recipient

View file

@ -13,6 +13,7 @@ def send_message(message: str, conversation_id: int) -> ChatMessage:
conversation = Conversation.query.get(conversation_id) conversation = Conversation.query.get(conversation_id)
reply = ChatMessage(sender_id=current_user.id, conversation_id=conversation.id, reply = ChatMessage(sender_id=current_user.id, conversation_id=conversation.id,
body=message, body_html=allowlist_html(markdown_to_html(message))) body=message, body_html=allowlist_html(markdown_to_html(message)))
conversation.updated_at = utcnow()
for recipient in conversation.members: for recipient in conversation.members:
if recipient.id != current_user.id: if recipient.id != current_user.id:
if recipient.is_local(): if recipient.is_local():