up
This commit is contained in:
+9
-1
@@ -748,6 +748,10 @@
|
||||
<div class="message ${msg.direction}">
|
||||
<div class="message-bubble">
|
||||
${content}
|
||||
<div class="message-actions mt-1">
|
||||
<button class="btn btn-sm btn-link" onclick="app.replyToMessage('${msg.message_id}','${msg.user_phone}')" title="Responder"><i class="fas fa-reply"></i></button>
|
||||
<button class="btn btn-sm btn-link" onclick="app.reactToMessage('${msg.message_id}','${msg.user_phone}')" title="Reaccionar"><i class="far fa-grin"></i></button>
|
||||
</div>
|
||||
<div class="message-time">
|
||||
${time}
|
||||
${msg.direction === 'outgoing' ? `<span class="message-status">${statusIcon}</span>` : ''}
|
||||
@@ -785,6 +789,7 @@
|
||||
document.getElementById('send-btn').disabled = true;
|
||||
|
||||
try {
|
||||
const replyTo = input.dataset.replyTo || null;
|
||||
const response = await fetch('api/send_message.php', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
@@ -792,9 +797,12 @@
|
||||
},
|
||||
body: JSON.stringify({
|
||||
user_id: this.currentUserId,
|
||||
message: message
|
||||
message: message,
|
||||
reply_to: replyTo
|
||||
})
|
||||
});
|
||||
// Clear reply data attribute
|
||||
input.dataset.replyTo = null;
|
||||
|
||||
const result = await response.json();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user