From 15ec9c51efd40f36173db331a039544cf9ca8470 Mon Sep 17 00:00:00 2001 From: Phillip Date: Fri, 5 May 2023 02:14:42 +0300 Subject: [PATCH] websocket chat limit 1 and fix reply name --- qortal-ui-plugins/plugins/core/components/ChatPage.js | 8 ++++---- qortal-ui-plugins/plugins/core/components/ChatScroller.js | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/qortal-ui-plugins/plugins/core/components/ChatPage.js b/qortal-ui-plugins/plugins/core/components/ChatPage.js index 3e405f4f..5abd8a9a 100644 --- a/qortal-ui-plugins/plugins/core/components/ChatPage.js +++ b/qortal-ui-plugins/plugins/core/components/ChatPage.js @@ -2919,11 +2919,11 @@ class ChatPage extends LitElement { if (window.parent.location.protocol === "https:") { - directSocketLink = `wss://${nodeUrl}/websockets/chat/messages?involving=${window.parent.reduxStore.getState().app.selectedAddress.address}&involving=${cid}`; + directSocketLink = `wss://${nodeUrl}/websockets/chat/messages?involving=${window.parent.reduxStore.getState().app.selectedAddress.address}&involving=${cid}&encoding=BASE64&limit=1`; } else { // Fallback to http - directSocketLink = `ws://${nodeUrl}/websockets/chat/messages?involving=${window.parent.reduxStore.getState().app.selectedAddress.address}&involving=${cid}`; + directSocketLink = `ws://${nodeUrl}/websockets/chat/messages?involving=${window.parent.reduxStore.getState().app.selectedAddress.address}&involving=${cid}&encoding=BASE64&limit=1`; } this.webSocket = new WebSocket(directSocketLink); @@ -3009,11 +3009,11 @@ class ChatPage extends LitElement { if (window.parent.location.protocol === "https:") { - groupSocketLink = `wss://${nodeUrl}/websockets/chat/messages?txGroupId=${groupId}`; + groupSocketLink = `wss://${nodeUrl}/websockets/chat/messages?txGroupId=${groupId}&encoding=BASE64&limit=1`; } else { // Fallback to http - groupSocketLink = `ws://${nodeUrl}/websockets/chat/messages?txGroupId=${groupId}`; + groupSocketLink = `ws://${nodeUrl}/websockets/chat/messages?txGroupId=${groupId}&encoding=BASE64&limit=1`; } this.webSocket = new WebSocket(groupSocketLink); diff --git a/qortal-ui-plugins/plugins/core/components/ChatScroller.js b/qortal-ui-plugins/plugins/core/components/ChatScroller.js index 382a8114..329fee83 100644 --- a/qortal-ui-plugins/plugins/core/components/ChatScroller.js +++ b/qortal-ui-plugins/plugins/core/components/ChatScroller.js @@ -642,7 +642,7 @@ class MessageTemplate extends LitElement { class=${this.myAddress !== repliedToData.sender ? "original-message-sender" : "message-data-my-name"}> - ${repliedToData.senderName ?? cropAddress(repliedToData.sender)} + ${repliedToData.senderName ? repliedToData.senderName : cropAddress(repliedToData.sender) }

${version.toString() === '1' ? html`