From 6501b591ceb67343719b0dd7a5f7ee0cb159cea4 Mon Sep 17 00:00:00 2001 From: Mashintime Date: Sun, 19 Feb 2023 00:02:06 -0500 Subject: [PATCH] save ping-acks in chat history --- gui/preload-chat.js | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/gui/preload-chat.js b/gui/preload-chat.js index aace6634..93ed5e08 100644 --- a/gui/preload-chat.js +++ b/gui/preload-chat.js @@ -634,6 +634,25 @@ ipcRenderer.on("action-new-msg-received", (event, arg) => { add_obj_to_database(obj); update_chat_obj_by_uuid(obj.uuid); + // handle beacon + } else if (item.ping == "acknowledge") { + obj.timestamp = parseInt(item.timestamp); + obj.dxcallsign = item.dxcallsign; + obj.dxgrid = item.dxgrid; + obj.uuid = item.uuid; + obj.command = "ping-ack"; + obj.checksum = "null"; + obj.msg = "null"; + obj.status = item.status; + obj.snr = item.dxsnr + "/" + item.snr; + obj.type = "ping-ack"; + obj.filename = "null"; + obj.filetype = "null"; + obj.file = "null"; + + add_obj_to_database(obj); + update_chat_obj_by_uuid(obj.uuid); + // handle beacon } else if (item.beacon == "received") { obj.timestamp = parseInt(item.timestamp); @@ -856,7 +875,13 @@ update_chat = function (obj) { var new_message = `

snr: ${obj.snr} - ${timestamp}

- +
+ `; + } + if (obj.type == "ping-ack") { + var new_message = ` +
+

Ping ack dx/mine snr: ${obj.snr} - ${timestamp}

`; }