up
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user