Skip to content

Commit

Permalink
Webchat: Fix issue accessing msg.id
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
hemna committed Sep 26, 2023
1 parent 6b083d4 commit d63c685
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions aprsd/web/chat/static/js/send-message.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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);
}
Expand All @@ -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?
Expand Down

0 comments on commit d63c685

Please sign in to comment.