Update chat_window.php
This commit is contained in:
+5
-2
@@ -635,10 +635,13 @@ if (empty($user_id)) {
|
|||||||
if (isMultimedia) {
|
if (isMultimedia) {
|
||||||
console.log('→ Renderizando como multimedia:', msg.message_type);
|
console.log('→ Renderizando como multimedia:', msg.message_type);
|
||||||
// Mensaje multimedia
|
// Mensaje multimedia
|
||||||
|
// Declarar variables de media aquí para evitar TDZ (referencias en otros `case`)
|
||||||
|
let thumbUrl = '';
|
||||||
|
let fullUrl = '';
|
||||||
switch (msg.message_type) {
|
switch (msg.message_type) {
|
||||||
case 'image':
|
case 'image':
|
||||||
// Determinar miniatura y URL completa (prioriza media_url_external o archivos locales)
|
// Determinar miniatura y URL completa (prioriza media_url_external o archivos locales)
|
||||||
let thumbUrl = '';
|
thumbUrl = '';
|
||||||
if (isValidMediaUrl(msg.local_thumb)) {
|
if (isValidMediaUrl(msg.local_thumb)) {
|
||||||
thumbUrl = `/${msg.local_thumb}`;
|
thumbUrl = `/${msg.local_thumb}`;
|
||||||
} else if (isValidMediaUrl(msg.local_file)) {
|
} else if (isValidMediaUrl(msg.local_file)) {
|
||||||
@@ -661,7 +664,7 @@ if (empty($user_id)) {
|
|||||||
thumbUrl = msg.media_url;
|
thumbUrl = msg.media_url;
|
||||||
}
|
}
|
||||||
|
|
||||||
let fullUrl = '';
|
fullUrl = '';
|
||||||
if (isValidMediaUrl(msg.local_file)) {
|
if (isValidMediaUrl(msg.local_file)) {
|
||||||
fullUrl = `/api/version/media-url.php?local=${encodeURIComponent(msg.local_file)}`;
|
fullUrl = `/api/version/media-url.php?local=${encodeURIComponent(msg.local_file)}`;
|
||||||
} else if (isValidMediaUrl(msg.media_url_external)) {
|
} else if (isValidMediaUrl(msg.media_url_external)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user