<?php
require_once '../config/database.php';
secureSessionStart();
requireLogin();

$conn = getConnection();
$message_id = isset($_POST['message_id']) ? intval($_POST['message_id']) : 0;

if ($message_id) {
    $query = "UPDATE support_messages SET is_read = 1, read_at = NOW() WHERE id = '$message_id'";
    mysqli_query($conn, $query);
}

echo json_encode(['success' => true]);
?>