Update chat_window.php
This commit is contained in:
+7
-6
@@ -570,19 +570,20 @@ if (empty($user_id)) {
|
|||||||
const isOutgoing = msg.direction === 'outgoing';
|
const isOutgoing = msg.direction === 'outgoing';
|
||||||
const messageClass = isOutgoing ? 'message-outgoing' : 'message-incoming';
|
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:', {
|
console.log('Procesando mensaje:', {
|
||||||
id: msg.id,
|
id: msg.id,
|
||||||
type: msg.message_type,
|
type: msg.message_type,
|
||||||
has_media_url: !!msg.media_url,
|
has_media_url: has_media,
|
||||||
media_url: msg.media_url,
|
media_url: msg.media_url || msg.media_url_external || msg.local_file || msg.local_thumb,
|
||||||
content: msg.content
|
content: msg.content
|
||||||
});
|
});
|
||||||
|
|
||||||
// Verificar si es multimedia (simplificado)
|
// Verificar si es multimedia (considerando varios orígenes de media)
|
||||||
let contentHtml = '';
|
let contentHtml = '';
|
||||||
const isMultimedia = msg.media_url && msg.media_url.trim() !== '' &&
|
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() !== '');
|
||||||
msg.message_type && msg.message_type !== 'text';
|
const isMultimedia = hasMediaUrl && msg.message_type && msg.message_type !== 'text';
|
||||||
|
|
||||||
if (isMultimedia) {
|
if (isMultimedia) {
|
||||||
console.log('→ Renderizando como multimedia:', msg.message_type);
|
console.log('→ Renderizando como multimedia:', msg.message_type);
|
||||||
|
|||||||
Reference in New Issue
Block a user