π Source: rename_chat.php
<?php
session_name('INBOXZERO');
session_start();
header('Content-Type: application/json');
$input = json_decode(file_get_contents('php://input'), true);
$chatId = $input['chat_id'] ?? '';
$newTitle = trim($input['title'] ?? '');
if ($chatId && !empty($newTitle) && isset($_SESSION['chat_histories'][$chatId])) {
// Pentru session-based, stocΔm titlul separat
if (!isset($_SESSION['chat_titles'])) {
$_SESSION['chat_titles'] = [];
}
$_SESSION['chat_titles'][$chatId] = $newTitle;
echo json_encode(['success' => true]);
} else {
echo json_encode(['error' => 'Invalid request']);
}
?>
β Back