From 6c93da460f33f5ed2d9a344cb5500b1510c93952 Mon Sep 17 00:00:00 2001 From: lizandrogd <77708265+lizandrogd@users.noreply.github.com> Date: Wed, 21 Jan 2026 12:47:02 -0500 Subject: [PATCH] Update chat_window.php --- chat_window.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/chat_window.php b/chat_window.php index 02ab464..7d0e025 100644 --- a/chat_window.php +++ b/chat_window.php @@ -570,19 +570,20 @@ if (empty($user_id)) { const isOutgoing = msg.direction === 'outgoing'; const messageClass = isOutgoing ? 'message-outgoing' : 'message-incoming'; - // Debug: ver todos los datos del mensaje + // Debug: ver todos los datos del mensaje (incluye media_url_external/local_file/local_thumb) + const has_media = !!(msg.media_url || msg.media_url_external || msg.local_file || msg.local_thumb); console.log('Procesando mensaje:', { id: msg.id, type: msg.message_type, - has_media_url: !!msg.media_url, - media_url: msg.media_url, + has_media_url: has_media, + media_url: msg.media_url || msg.media_url_external || msg.local_file || msg.local_thumb, content: msg.content }); - // Verificar si es multimedia (simplificado) + // Verificar si es multimedia (considerando varios orígenes de media) let contentHtml = ''; - const isMultimedia = msg.media_url && msg.media_url.trim() !== '' && - msg.message_type && msg.message_type !== 'text'; + const hasMediaUrl = (msg.media_url && msg.media_url.trim() !== '') || (msg.media_url_external && msg.media_url_external.trim() !== '') || (msg.local_file && msg.local_file.trim() !== '') || (msg.local_thumb && msg.local_thumb.trim() !== ''); + const isMultimedia = hasMediaUrl && msg.message_type && msg.message_type !== 'text'; if (isMultimedia) { console.log('→ Renderizando como multimedia:', msg.message_type);