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