<?php
session_start();
require_once 'conexao.php';

if (!isset($_SESSION['logado']) || $_SESSION['logado'] !== true) {
    http_response_code(401);
    exit;
}

$usuario_id = $_SESSION['usuario_id'];

$stmt = $conn->prepare("UPDATE usuarios SET nova_mensagem = 0 WHERE id = ?");
$stmt->bind_param("i", $usuario_id);
$stmt->execute();
$stmt->close();
$conn->close();
?>
