From 44407f11b6c7f5f06fe198be9b5c06757131996a Mon Sep 17 00:00:00 2001 From: Miroslav Pejic Date: Sat, 3 Sep 2022 12:46:33 +0200 Subject: [PATCH] [mirotalksfu] - improve chat private msgs --- public/js/RoomClient.js | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/public/js/RoomClient.js b/public/js/RoomClient.js index 70b686dc..67d8585a 100644 --- a/public/js/RoomClient.js +++ b/public/js/RoomClient.js @@ -2175,10 +2175,7 @@ class RoomClient { appendMessage(side, img, fromName, fromId, msg, toId, toName) { let time = this.getTimeNow(); let msgBubble = toId == 'all' ? 'msg-bubble' : 'msg-bubble-private'; - let replyMsg = - fromId === this.peer_id - ? `
Private message to ${toName}` - : `
`; + let replyMsg = fromId === this.peer_id ? `
Private message to ${toName}` : ''; let message = toId == 'all' ? msg : msg + replyMsg; let msgHTML = `
@@ -2200,6 +2197,17 @@ class RoomClient { class="fas fa-copy" onclick="rc.copyToClipboard('${chatMessagesId}')" > + `; + // add btn direct reply to private message + if (fromId != this.peer_id) { + msgHTML += ` + `; + } + msgHTML += `
@@ -2209,6 +2217,7 @@ class RoomClient { chatMsger.scrollTop += 500; this.setTippy('msg-delete-' + chatMessagesId, 'Delete', 'top'); this.setTippy('msg-copy-' + chatMessagesId, 'Copy', 'top'); + this.setTippy('msg-private-reply-' + chatMessagesId, 'Reply', 'top'); chatMessagesId++; }