From d63c6854aff0d5962d7e9a6aca277606955bdf49 Mon Sep 17 00:00:00 2001 From: Hemna Date: Tue, 26 Sep 2023 11:04:59 -0400 Subject: [PATCH] Webchat: Fix issue accessing msg.id After the refactor of the messages object in webchat, we are sending a direct json dict version of the packet now. This means there is no msg.id in the dict, but msg.msgNo instead. This should help fix the display of dupes. --- aprsd/web/chat/static/js/send-message.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/aprsd/web/chat/static/js/send-message.js b/aprsd/web/chat/static/js/send-message.js index cb2d91bb..3ae29e31 100644 --- a/aprsd/web/chat/static/js/send-message.js +++ b/aprsd/web/chat/static/js/send-message.js @@ -353,7 +353,7 @@ function append_message_html(callsign, msg_html, new_callsign) { } function create_message_html(date, time, from, to, message, ack_id, msg, acked=false) { - div_id = from + "_" + msg.id; + div_id = from + "_" + msg.msgNo; if (ack_id) { alt = " alt" } else { @@ -400,7 +400,7 @@ function create_message_html(date, time, from, to, message, ack_id, msg, acked=f function flash_message(msg) { // Callback function to bring a hidden box back - id = msg.from + "_" + msg.id; + id = msg.from + "_" + msg.msgNo; var msgid = $('#'+id); msgid.effect("pulsate", { times:3 }, 2000); } @@ -423,7 +423,7 @@ function from_msg(msg) { from_msg_list[msg.from_call] = new Array(); } - if (msg.id in from_msg_list[msg.from_call]) { + if (msg.msgNo in from_msg_list[msg.from_call]) { // We already have this message console.log("We already have this message " + msg); // Do some flashy thing?