implement socket heartbeat

This commit is contained in:
2025-05-27 16:12:15 +02:00
parent e9b1fb6577
commit 45b3fb0cd6
3 changed files with 31 additions and 11 deletions

View File

@@ -258,6 +258,12 @@ def on_leave(data):
conversation_id = data.get('conversation_id')
leave_room(f'conversation_{conversation_id}')
@socketio.on('heartbeat')
@login_required
def on_heartbeat(data):
# Just acknowledge the heartbeat to keep the connection alive
return {'status': 'ok'}
@conversations_bp.route('/<int:conversation_id>/send_message', methods=['POST'])
@login_required
@require_password_change