From 9d67627057d6fa2c756abd3d7e4d6e7f6131247d Mon Sep 17 00:00:00 2001 From: Lizandro Guarnizo <77708265+lizandrogd@users.noreply.github.com> Date: Fri, 23 Jan 2026 22:56:18 -0500 Subject: [PATCH] Update conversations.php --- conversations.php | 70 +++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 67 insertions(+), 3 deletions(-) diff --git a/conversations.php b/conversations.php index ea5a412..d7566d7 100644 --- a/conversations.php +++ b/conversations.php @@ -204,6 +204,25 @@ margin-top: 5px; } + /* Diseño estilo ventana: timestamp oculto hasta hover */ + .message-bubble { + position: relative; + } + .message-bubble .message-time { + position: absolute; + right: 8px; + bottom: 4px; + font-size: 10px; + color: #666; + opacity: 0; + transition: opacity 0.12s ease-in-out; + white-space: nowrap; + } + .message-bubble:hover .message-time, + .message-bubble:focus-within .message-time { + opacity: 1; + } + .message-status { display: inline-block; margin-left: 5px; @@ -747,6 +766,28 @@ this.sendMessage(); }); + // Edit user name button + const editUserBtn = document.getElementById('edit-user-btn'); + if (editUserBtn) editUserBtn.addEventListener('click', () => this.promptEditUser()); + + // Reply prompt helper: when user clicks reply on a message + this.promptReply = function(messageId) { + const input = document.getElementById('message-input'); + if (!input) return; + input.dataset.replyTo = messageId; + input.focus(); + // Optionally show a small UI indicator (not implemented) + }; + + // React to message placeholder + this.reactToMessage = function(messageId) { + // simple emoji picker or quick reaction; for now show a prompt + const e = prompt('Reaccionar con emoji (ej: 👍):'); + if (!e) return; + fetch('api/react_message.php', { method: 'POST', headers: {'Content-Type':'application/json'}, body: JSON.stringify({ message_id: messageId, emoji: e }) }) + .then(r => r.json()).then(j => { if (j && j.success) { this.loadconversations(this.currentUserId, false); } else { alert('Error reaccionando'); } }).catch(err => { console.error(err); alert('Error reaccionando'); }); + }; + // Message type (text/template) const typeSelect = document.getElementById('message-type'); if (typeSelect) { @@ -1517,7 +1558,7 @@