This commit is contained in:
lizandrogd
2026-01-21 01:02:17 -05:00
parent 4e3e02111b
commit 87b89b52a5
14 changed files with 387 additions and 36 deletions
+32
View File
@@ -1028,6 +1028,38 @@ class WhatsAppBotManager {
this.showTab('messages');
}
replyToMessage(messageId, userPhone) {
// Poner en el input del chat y almacenar reply_to en data attribute
document.getElementById('message-input').focus();
document.getElementById('message-input').dataset.replyTo = messageId;
this.showSuccess('Preparado para responder al mensaje ' + messageId);
}
async reactToMessage(messageId, userPhone) {
const emoji = prompt('Escribe el emoji de reacción (ej: ❤️, 👍):');
if (!emoji) return;
try {
const resp = await fetch('api/send_reaction.php', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ to: userPhone, message_id: messageId, emoji: emoji })
});
const data = await resp.json();
if (data.success) {
this.showSuccess('Reacción enviada');
// Refrescar mensajes
await this.loadMessages(this.currentUserId, false);
} else {
this.showError('Error enviando reacción: ' + (data.error || 'desconocido'));
}
} catch (err) {
console.error('reactToMessage error', err);
this.showError('Error comunicándose con el servidor');
}
}
editUser(userId) {
// Implementar modal de edición de usuario
console.log('Editar usuario:', userId);