up
This commit is contained in:
@@ -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'])),
|
||||
|
||||
@@ -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';
|
||||
|
||||
Reference in New Issue
Block a user