diff --git a/modules/turnero/views/chat.php b/modules/turnero/views/chat.php index 37e2e38..77e3acc 100644 --- a/modules/turnero/views/chat.php +++ b/modules/turnero/views/chat.php @@ -752,7 +752,9 @@ function buildBubble(msg) { div.dataset.msgId = msg.id; div.dataset.waId = msg.message_id || ''; - const mediaSrc = msg.local_file ? ('../' + msg.local_file) : (msg.media_url_external || null); + const _base = window.location.origin; + const _toAbs = p => p ? (p.startsWith('http') ? p : `${_base}/${p.replace(/^\//, '')}`) : null; + const mediaSrc = msg.local_file ? _toAbs(msg.local_file) : (msg.media_url_external ? _toAbs(msg.media_url_external) : null); let content = ''; if (msg.message_type === 'image' && mediaSrc) { @@ -762,8 +764,18 @@ function buildBubble(msg) { } else if (msg.message_type === 'video' && mediaSrc) { content = ``; if (msg.content) content += `