Update chat_window.php

This commit is contained in:
lizandrogd
2026-01-21 12:47:02 -05:00
parent 3e57e6946c
commit 6c93da460f
+7 -6
View File
@@ -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);