diff --git a/modules/turnero/views/chat.php b/modules/turnero/views/chat.php index 8c16ae4..93f0f73 100644 --- a/modules/turnero/views/chat.php +++ b/modules/turnero/views/chat.php @@ -578,6 +578,10 @@ let state = { // ── Init ───────────────────────────────────────────────────────────────────── document.addEventListener('DOMContentLoaded', () => { loadContacts(); + // Permite llegar directo a una conversación desde otra pantalla, por ejemplo + // desde la bitácora del turno en el historial: ?v=chat&user_id=123 + const _uid = parseInt(new URLSearchParams(location.search).get('user_id') || '', 10); + if (_uid > 0) openChat(_uid); document.getElementById('searchInput').addEventListener('input', debounce(() => { loadContacts(document.getElementById('searchInput').value.trim()); }, 300));