added extra log

This commit is contained in:
2025-05-31 22:19:59 +02:00
parent ac49c842b8
commit fda5655533
5 changed files with 16 additions and 0 deletions

View File

@@ -85,6 +85,22 @@ def create_conversation():
db.session.add(conversation)
db.session.commit()
# Create notifications for all members except the creator
for member in conversation.members:
if member.id != current_user.id:
create_notification(
notif_type='conversation_invite',
user_id=member.id,
sender_id=current_user.id,
details={
'message': f'You have been added to conversation "{conversation.name}"',
'conversation_id': conversation.id,
'conversation_name': conversation.name,
'invited_by': f"{current_user.username} {current_user.last_name}",
'timestamp': datetime.utcnow().isoformat()
}
)
# Log conversation creation
log_event(
event_type='conversation_create',