This commit is contained in:
lizandrogd
2026-01-13 02:24:18 -05:00
parent ccea8adefa
commit f0a713e1da
5 changed files with 92 additions and 7 deletions
+6
View File
@@ -48,10 +48,15 @@ try {
direction,
message_type,
content,
media_url,
status,
created_at
FROM conversations
WHERE user_id = ?
AND (
message_type = 'text'
OR (message_type IN ('image', 'audio', 'video', 'document') AND media_url IS NOT NULL AND media_url != '')
)
ORDER BY created_at ASC",
[$user_id]
);
@@ -64,6 +69,7 @@ try {
'direction' => $msg['direction'],
'message_type' => $msg['message_type'],
'content' => $msg['content'] ?? '',
'media_url' => $msg['media_url'] ?? null,
'status' => $msg['status'] ?? 'sent',
'created_at' => $msg['created_at'],
'time' => date('H:i', strtotime($msg['created_at'])),
+1 -1
View File
@@ -86,7 +86,7 @@ try {
// Construir URL pública
$protocol = isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? 'https' : 'http';
$host = $_SERVER['HTTP_HOST'];
$publicUrl = $protocol . '://' . $host . '/whatsapp/uploads/' . $uniqueName;
$publicUrl = $protocol . '://' . $host . '/uploads/' . $uniqueName;
// Determinar tipo de medio
$mediaType = 'document';