From da3204380d8747e69c6a56f2c478966f5fda748e Mon Sep 17 00:00:00 2001 From: Casu Al Snek Date: Sun, 12 Jan 2025 22:34:35 +0545 Subject: [PATCH] Ft: Add self marker in chat message get request --- backend/blueprints/chat/__init__.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/backend/blueprints/chat/__init__.py b/backend/blueprints/chat/__init__.py index 41f9177..d49db7a 100644 --- a/backend/blueprints/chat/__init__.py +++ b/backend/blueprints/chat/__init__.py @@ -103,12 +103,12 @@ def get_messages(): 'text': msg.textContent, 'userId': str(msg.userID), 'username': msg.user.username, - 'timestamp': msg.chatDate.isoformat() + 'timestamp': msg.chatDate.isoformat(), + 'isSelf': int(msg.userID == g.current_user.id) } for msg in messages] return jsonify({ 'messages': chat_messages, 'count': len(chat_messages), }), 200 except Exception as e: - raise e - # return jsonify({'message': f'An error occurred: {str(e)}'}), 500 \ No newline at end of file + return jsonify({'message': f'An error occurred: {str(e)}'}), 500 \ No newline at end of file